Package breitband.GUI.elements
Class GCable
- java.lang.Object
-
- sag.elements.GElement
-
- sag.elements.GGroup
-
- breitband.preset.GLineWithMarkers
-
- breitband.GUI.elements.GCable
-
- All Implemented Interfaces:
java.lang.Iterable<sag.elements.GElement>
,sag.elements.Drawable
public class GCable extends breitband.preset.GLineWithMarkers
A class used for drawing cables as lines with iconsThe icons are set to the cable type and the player color
The amount of icons indicates the amount of cables used to build this line
- Author:
- Juno Veenstra
-
-
Field Summary
Fields Modifier and Type Field Description static float
ICON_RATIO
The ratio of the icon's size to the width of the cablestatic float
SCREEN_SPACE_WIDTH
Width of the cable in screen space
-
Constructor Summary
Constructors Constructor Description GCable(float x1, float y1, float x2, float y2, CableConfig cable, java.awt.Color color, java.lang.String playerName, int amount)
Cable constructor, draws a line with markers
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CableConfig
getCableConfig()
java.lang.String
getOwner()
void
scaleToScreen(float scale)
Scale the width and icons to be screenSpace-
Methods inherited from class breitband.preset.GLineWithMarkers
addChild, addChild, addEmojiMarkers, addFontAwesomeMarkers, getPosition1X, getPosition1Y, getPosition2X, getPosition2Y, realignElements, removeChild, resizeMarkers, setPosition1, setPosition2, setStroke, setStroke, setStrokeWidth
-
Methods inherited from class sag.elements.GGroup
getChildByRenderingIndex, getNumChildren, getRawSVGGroup, indexOfChild, iterator, processMouseButtonEvent, processMouseMotionEvent, processMouseWheelEvent, renderChildAfter, renderChildBefore, renderChildEarlier, renderChildFirst, renderChildLast, renderChildLater, setChildRenderingIndex, setRootSAGPanel, swapChildren
-
Methods inherited from class sag.elements.GElement
amIPicked, executeUpdate, flipHorizontal, flipVertical, getGElement, getParent, getPositionX, getPositionY, getRGBStringFromColor, getRootSAGPanel, getRotation, getScaleX, getScaleY, getSkewX, getSkewY, move, removeCSSAttribute, removeXMLAttribute, rotate, scale, scale, setAttribute, setCSSAttribute, setCSSAttribute, setDisplay, setFill, setFill, setFillOpacity, setMouseEventListener, setOpacity, setParent, setPosition, setRotation, setScale, setScale, setSkew, setStroke, setStrokeLinecap, setStrokeLinejoin, setStrokeOpacity, setStrokePattern, setStrokePatternOffset, setXMLAttribute, setXMLAttribute, skew, unsetFill, unsetFillOpacity, unsetOpacity, unsetStroke, unsetStrokeLinecap, unsetStrokeLinejoin, unsetStrokeOpacity, unsetStrokePattern, unsetStrokePatternOffset, unsetStrokeWidth, update, updateTransform
-
-
-
-
Field Detail
-
ICON_RATIO
public static final float ICON_RATIO
The ratio of the icon's size to the width of the cable- See Also:
- Constant Field Values
-
SCREEN_SPACE_WIDTH
public static final float SCREEN_SPACE_WIDTH
Width of the cable in screen space- See Also:
- Constant Field Values
-
-
Constructor Detail
-
GCable
public GCable(float x1, float y1, float x2, float y2, CableConfig cable, java.awt.Color color, java.lang.String playerName, int amount)
Cable constructor, draws a line with markers- Parameters:
x1
- Start xy1
- Start yx2
- End xy2
- End ycable
- Cable typecolor
- Player/marker colorplayerName
- Player nameamount
- Amount of cables used and amount of markers shown
-
-
Method Detail
-
scaleToScreen
public void scaleToScreen(float scale)
Scale the width and icons to be screenSpace- Parameters:
scale
- Scale to which the cable gets set, should be the inverse of the zoom level
-
getCableConfig
public CableConfig getCableConfig()
-
getOwner
public java.lang.String getOwner()
-
-