Interface Graphic
-
- All Known Subinterfaces:
- AggregateGraphic, GraphicArc, GraphicIcon, GraphicLabel, GraphicLineString, GraphicPolygon, GraphicScaledImage
public interface GraphicGraphicdefines the root abstraction of a graphic object taxonomy, specifying the methods common to a lightweight set of graphic objects.
-
-
Field Summary
Fields Modifier and Type Field and Description static booleanDEFAULT_AUTO_EDITDefault auto edit value.static float[]DEFAULT_BLINK_PATTERNDefault blink pattern value.static booleanDEFAULT_BLINKINGDefault blinking value.static booleanDEFAULT_DRAG_SELECTABLEDefault drag selectable value.static intDEFAULT_MAX_SCALEDefault max scale value.static intDEFAULT_MIN_SCALEDefault min scale value.static booleanDEFAULT_PICKABLEDefault pickable value.static booleanDEFAULT_SELECTEDDefault selected value.static booleanDEFAULT_VISIBLEDefault visible value.static doubleDEFAULT_Z_ORDERDefault z order value.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method and Description voidaddGraphicListener(GraphicListener listener)Adds the givenGraphicListenerto thisGraphic's list of listeners.GraphiccloneGraphic()Creates a newGraphicof the same type as this object.voiddispose()Method that can be called when an object is no longer needed.voidfireGraphicEvent(GraphicEvent ge)Calls the graphic event method of allGraphicListeners in thisGraphic's list of listeners.booleangetAutoEdit()Returns the auto edit value.booleangetBlinking()Returns the blinking value.float[]getBlinkPattern()Returns the blink pattern value.java.lang.ObjectgetClientProperty(java.lang.Object key)Returns the value of the property with the specified key.booleangetDragSelectable()Returns the drag selectable value.GraphicStylegetGraphicStyle()Returns theGraphicStylefor thisGraphic.doublegetMaxScale()Returns the max scale value.doublegetMinScale()Returns the min scale value.java.lang.StringgetName()Returns the name assigned to thisGraphic.GraphicgetParent()Returns the parent of thisGraphic.booleangetPickable()Returns the pickable value.booleangetSelected()Returns the selected value.SymbologygetSymbology()Returns a symbology object that will be used to override some, if not all, of the graphical properties of Graphics using this style.booleangetVisible()Returns the visible value.doublegetZOrderHint()Returns the z order hint value.booleanisPassingEventsToParent()Returns a boolean indicating whether mouse events on thisGraphicwill be passed to the parentGraphicin addition to being passed to any listeners on this object.booleanisShowingAnchorHandles()Returns the boolean flag that indicates whether this object is showing anchor handles.booleanisShowingEditHandles()Returns the boolean flag that specifies whether this object is showing its edit handles.voidputClientProperty(java.lang.Object key, java.lang.Object value)Adds an arbitrary key/value "client property" to thisGraphic.voidrefresh()Flags thisGraphicobject as needing to be redrawn, due to changes to the internal data of the object which affect the rendering of the object.voidremoveGraphicListener(GraphicListener listener)Removes the givenGraphicListenerfrom thisGraphic's list of listeners.voidsetAutoEdit(boolean autoEdit)Sets the auto edit value.voidsetBlinking(boolean blinking)Sets the blinking value.voidsetBlinkPattern(float[] blinkPattern)Sets the blink pattern value.voidsetDragSelectable(boolean dragSelectable)Sets the drag selectable value.voidsetGraphicStyle(GraphicStyle style)Sets theGraphicStylefor thisGraphic.voidsetMaxScale(double maxScale)Sets the max scale value.voidsetMinScale(double minScale)Sets the min scale value.voidsetName(java.lang.String name)Sets the name of thisGraphicto the given value.voidsetParent(Graphic parent)Sets the parent of thisGraphic.voidsetPassingEventsToParent(boolean passToParent)Sets a boolean indicating whether mouse events on thisGraphicshould be passed to the parentGraphicin addition to being passed to any listeners on this object.voidsetPickable(boolean pickable)Sets the pickable value.voidsetSelected(boolean selected)Sets the selected value.voidsetShowingAnchorHandles(boolean showingHandles)Sets a boolean flag indicating whether this object is to show anchor handles.voidsetShowingEditHandles(boolean showingHandles)Sets a boolean flag specifying whether this object is to show its edit handles.voidsetSymbology(Symbology symbology)Sets the symbology object that will be used to override some, if not all, of the graphical properties of Graphics using this style.voidsetVisible(boolean visible)Sets the visible value.voidsetZOrderHint(double zOrderHint)Sets the z order hint value.
-
-
-
Field Detail
-
DEFAULT_AUTO_EDIT
static final boolean DEFAULT_AUTO_EDIT
Default auto edit value.- See Also:
- Constant Field Values
-
DEFAULT_DRAG_SELECTABLE
static final boolean DEFAULT_DRAG_SELECTABLE
Default drag selectable value.- See Also:
- Constant Field Values
-
DEFAULT_PICKABLE
static final boolean DEFAULT_PICKABLE
Default pickable value.- See Also:
- Constant Field Values
-
DEFAULT_SELECTED
static final boolean DEFAULT_SELECTED
Default selected value.- See Also:
- Constant Field Values
-
DEFAULT_BLINKING
static final boolean DEFAULT_BLINKING
Default blinking value.- See Also:
- Constant Field Values
-
DEFAULT_BLINK_PATTERN
static final float[] DEFAULT_BLINK_PATTERN
Default blink pattern value.
-
DEFAULT_MAX_SCALE
static final int DEFAULT_MAX_SCALE
Default max scale value.- See Also:
- Constant Field Values
-
DEFAULT_MIN_SCALE
static final int DEFAULT_MIN_SCALE
Default min scale value.- See Also:
- Constant Field Values
-
DEFAULT_VISIBLE
static final boolean DEFAULT_VISIBLE
Default visible value.- See Also:
- Constant Field Values
-
DEFAULT_Z_ORDER
static final double DEFAULT_Z_ORDER
Default z order value.- See Also:
- Constant Field Values
-
-
Method Detail
-
dispose
void dispose()
Method that can be called when an object is no longer needed. Implementations may use this method to release resources, if needed. Implementations may also implement this method to return an object to an object pool. It is an error to reference aGraphicin any way after its dispose method has been called.
-
refresh
void refresh()
Flags thisGraphicobject as needing to be redrawn, due to changes to the internal data of the object which affect the rendering of the object.The actual flag set/unset mechanism is implementation-specific. The implementation also choses the manner and timing in which both the flag is checked and the
Graphicobject is redrawn.An application would call this method when any geometric information for this
Graphicobject has changed; for example, when the underlyingGeometryinstance is changed or data in that instance has changed.
-
setName
void setName(java.lang.String name)
Sets the name of thisGraphicto the given value.- Parameters:
name- the new name to assign to thisGraphic.
-
getName
java.lang.String getName()
Returns the name assigned to thisGraphic.- Returns:
- the name assigned to this
Graphic.
-
setParent
void setParent(Graphic parent)
Sets the parent of thisGraphic.- Parameters:
parent- the parent of thisGraphic.
-
getParent
Graphic getParent()
Returns the parent of thisGraphic. Currently, onlyAggregateGraphics haveGraphicchildren.- Returns:
- the parent of this
Graphic.
-
setGraphicStyle
void setGraphicStyle(GraphicStyle style)
Sets theGraphicStylefor thisGraphic.Graphics may share style property objects with otherGraphics.
-
getGraphicStyle
GraphicStyle getGraphicStyle()
Returns theGraphicStylefor thisGraphic. Implementations should return a reference to their internalGraphicStyleobject, so that users may modify thisGraphic's style properties directly through the style object.- Returns:
- the
GraphicStyle.
-
getClientProperty
java.lang.Object getClientProperty(java.lang.Object key)
Returns the value of the property with the specified key. Only properties added withputClientPropertywill return a non-null value.- Returns:
- the value of this property or null
- See Also:
putClientProperty(java.lang.Object, java.lang.Object)
-
putClientProperty
void putClientProperty(java.lang.Object key, java.lang.Object value)Adds an arbitrary key/value "client property" to thisGraphic. Theget/putClientPropertymethods provide access to a small per-instance hashtable. Callers can useget/putClientPropertyto annotateGraphics that were created by another module.If value is null this method will remove the property. Changes to client properties are reported with property change events. The name of the property (for the sake of property change events) is
key.toString(). TheclientPropertydictionary is not intended to support large scale extensions toGraphicnor should be it considered an alternative to subclassing when designing a new component.- Parameters:
key- the Object containing the key string.value- the Object that is the client data.- See Also:
getClientProperty(java.lang.Object)
-
setPassingEventsToParent
void setPassingEventsToParent(boolean passToParent)
Sets a boolean indicating whether mouse events on thisGraphicshould be passed to the parentGraphicin addition to being passed to any listeners on this object. The default is false, indicating that events will not be passed to the parent. If the boolean is true, then the event will be passed to the parent after having been passed to the listeners on this object.- Parameters:
passToParent-trueif events should be passed to the parent graphic,falseif they should not.
-
isPassingEventsToParent
boolean isPassingEventsToParent()
Returns a boolean indicating whether mouse events on thisGraphicwill be passed to the parentGraphicin addition to being passed to any listeners on this object. The default isfalse, indicating that events will not be passed to the parent. If the boolean istrue, then the event will be passed to the parent after having been passed to the listeners on this object.- Returns:
trueif this graphic pass the events to the parent graphic.
-
setShowingEditHandles
void setShowingEditHandles(boolean showingHandles)
Sets a boolean flag specifying whether this object is to show its edit handles. Edit handles are the small boxes that appear on the end of a line segment or on the four corners of a box that a users selects to edit this object.- Parameters:
showingHandles-trueif this object show its edit handles.
-
isShowingEditHandles
boolean isShowingEditHandles()
Returns the boolean flag that specifies whether this object is showing its edit handles.- Returns:
truemeans it is showing its handles.
-
setShowingAnchorHandles
void setShowingAnchorHandles(boolean showingHandles)
Sets a boolean flag indicating whether this object is to show anchor handles. Anchor handles allow the object to be moved in the display.
-
isShowingAnchorHandles
boolean isShowingAnchorHandles()
Returns the boolean flag that indicates whether this object is showing anchor handles. Anchor handles allow the object to be moved in the display.
-
cloneGraphic
Graphic cloneGraphic()
Creates a newGraphicof the same type as this object. The resulting object should be identical in all respects to the original.
-
addGraphicListener
void addGraphicListener(GraphicListener listener)
Adds the givenGraphicListenerto thisGraphic's list of listeners.GraphicListeners are notified of key, mouse, and change events that affect thisGraphic.- Parameters:
listener- theGraphicListenerto add.
-
removeGraphicListener
void removeGraphicListener(GraphicListener listener)
Removes the givenGraphicListenerfrom thisGraphic's list of listeners.- Parameters:
listener- theGraphicListenerto remove.
-
fireGraphicEvent
void fireGraphicEvent(GraphicEvent ge)
Calls the graphic event method of allGraphicListeners in thisGraphic's list of listeners. The listeners need to determine which subclassed event is called and what event-specific action was taken.- Parameters:
ge- theGraphicEventto give to the listeners.- See Also:
GraphicListener,GraphicEvent,GraphicChangeEvent,GraphicMouseEvent
-
getAutoEdit
boolean getAutoEdit()
Returns the auto edit value.- Returns:
- the auto edit value.
-
setAutoEdit
void setAutoEdit(boolean autoEdit)
Sets the auto edit value.- Parameters:
autoEdit- the auto edit value.
-
getDragSelectable
boolean getDragSelectable()
Returns the drag selectable value.- Returns:
- the drag selectable value.
-
setDragSelectable
void setDragSelectable(boolean dragSelectable)
Sets the drag selectable value.- Parameters:
dragSelectable- the drag selectable value.
-
getPickable
boolean getPickable()
Returns the pickable value.- Returns:
- the pickable value.
-
setPickable
void setPickable(boolean pickable)
Sets the pickable value.- Parameters:
pickable- the pickable value.
-
getSelected
boolean getSelected()
Returns the selected value.- Returns:
- the selected value.
-
setSelected
void setSelected(boolean selected)
Sets the selected value.- Parameters:
selected- the selected value.
-
getBlinking
boolean getBlinking()
Returns the blinking value.- Returns:
- the blinking value.
-
setBlinking
void setBlinking(boolean blinking)
Sets the blinking value.- Parameters:
blinking- the blinking value.
-
getBlinkPattern
float[] getBlinkPattern()
Returns the blink pattern value.- Returns:
- the blink pattern value.
-
setBlinkPattern
void setBlinkPattern(float[] blinkPattern)
Sets the blink pattern value.- Parameters:
blinkPattern- the blink pattern value.
-
getSymbology
Symbology getSymbology()
Returns a symbology object that will be used to override some, if not all, of the graphical properties of Graphics using this style. This will be null by default.
-
setSymbology
void setSymbology(Symbology symbology)
Sets the symbology object that will be used to override some, if not all, of the graphical properties of Graphics using this style.
-
getMaxScale
double getMaxScale()
Returns the max scale value.- Returns:
- the max scale value.
-
setMaxScale
void setMaxScale(double maxScale)
Sets the max scale value.- Parameters:
maxScale- the max scale value.
-
getMinScale
double getMinScale()
Returns the min scale value.- Returns:
- the min scale value.
-
setMinScale
void setMinScale(double minScale)
Sets the min scale value.- Parameters:
minScale- the min scale value.
-
getZOrderHint
double getZOrderHint()
Returns the z order hint value.- Returns:
- the z order hint value.
-
setZOrderHint
void setZOrderHint(double zOrderHint)
Sets the z order hint value.- Parameters:
zOrderHint- the z order hint value.
-
getVisible
boolean getVisible()
Returns the visible value.- Returns:
- the visible value.
-
setVisible
void setVisible(boolean visible)
Sets the visible value.- Parameters:
visible- the visible value.
-
-
DataMelt 3.0 © DataMelt by jWork.ORG