com.supermap.mapping.dyn
Class DynamicElement
- java.lang.Object
-
- com.supermap.mapping.dyn.DynamicElement
-
- Direct Known Subclasses:
- DynamicChart, DynamicCircle, DynamicLine, DynamicPoint, DynamicPolygon, DynamicText
public abstract class DynamicElement extends java.lang.ObjectThe base class of the dynamic object.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class and Description static classDynamicElement.ElementTypeThe dynamic element type.static interfaceDynamicElement.OnClickListenerThe listener of dynamic data click event.static interfaceDynamicElement.OnDownAndUpListenerThe OnDownAndUpListener for dynamic datastatic interfaceDynamicElement.OnLongPressListenerThe listener of dynamic data long-click event.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method and Description voidaddAnimator(Animator animator)Adds the animation to the dynamic element.voidaddPoint(Point2D pt)Adds the point.voidaddPoints(Point2Ds ps)Add point setvoiddispose()Disposes resources.abstract booleanfromGeometry(Geometry geometry)Create the dynamic data through Geometry.Rectangle2DgetBounds()Gets the range of dynamic object.Point2DsgetGeoPoints()Gets the tuples.intgetID()Gets the ID of dynamic object.doublegetMinShowScale()Gets the minimum display scale.java.lang.StringgetName()Gets the name of the dynamic object, and the default problem null.intgetNameColor()Gets the name font color.floatgetNameOffsetX()floatgetNameOffsetY()Gets the Y offset of the name text.Point2DgetNamePosition()Gets the location coordinates of the name text, and if the user does not have the setting, the object center point is adopted by default.floatgetNameSize()Gets the name font size.DynamicAlignmentgetNameTextAlign()Gets the name text to its method, the default center alignment.DynamicElement.OnDownAndUpListenergetOnDownAndUpListener()Gets the listener OnDownAndUpListener of the objectDynamicElement.OnLongPressListenergetOnLongPressListener()Gets the long-click listening of this objectjava.util.ArrayList<java.lang.Integer>getPart()Gets the point string group info.DynamicStylegetStyle()Gets the style.java.lang.StringgetTag()Gets the label.DynamicElement.ElementTypegetType()Gets the type.java.lang.ObjectgetUserData()Gets the user data.booleanisNameVisible()Gets whether the dynamic object name is visible, and the default false.voidsetMinShowScale(double scale)Sets the minimum display scale.voidsetName(java.lang.String name)Sets the name of a dynamic object.voidsetNameColor(int color)Sets name font color, default blackvoidsetNameOffsetX(float offsetX)Sets the X offset of the name text.voidsetNameOffsetY(float offsetY)Sets the Y offset of the name text.voidsetNamePosition(Point2D position)Sets the location of the name text.voidsetNameSize(float size)Sets name font size default 16pixel.voidsetNameTextAlign(DynamicAlignment align)Sets the name text to its method, the default center alignment.voidsetNameVisible(boolean visible)Sets whether the dynamic object name is visible, and is not visible by default.voidsetOnClickListenner(DynamicElement.OnClickListener listener)Sets the clicking listener.voidsetOnDownAndUpListener(DynamicElement.OnDownAndUpListener listener)Sets the listeners as fingers press down or leave dynamic objects.voidsetOnLongPressListener(DynamicElement.OnLongPressListener listener)Sets the long-click listener.voidsetStyle(DynamicStyle style)Sets the style.voidsetTag(java.lang.String tag)Sets the label.voidsetUserData(java.lang.Object data)Sets the user data.voidupdatePoint(int index, Point2D pt)Updates the point.
-
-
-
Method Detail
-
setStyle
public void setStyle(DynamicStyle style)
Sets the style.- Parameters:
style- The style.
-
setUserData
public void setUserData(java.lang.Object data)
Sets the user data.- Parameters:
data- The user data.
-
getUserData
public java.lang.Object getUserData()
Gets the user data.- Returns:
- The user data.
-
getStyle
public DynamicStyle getStyle()
Gets the style.- Returns:
- The style of the dynamic object.
-
getType
public DynamicElement.ElementType getType()
Gets the type.- Returns:
- The type of dynamic object.
-
getGeoPoints
public Point2Ds getGeoPoints()
Gets the tuples.- Returns:
- The point string of dynamic object.
-
getPart
public java.util.ArrayList<java.lang.Integer> getPart()
Gets the point string group info.- Returns:
- The point string group info.
-
getID
public int getID()
Gets the ID of dynamic object.- Returns:
- The ID of dynamic object.
-
getBounds
public Rectangle2D getBounds()
Gets the range of dynamic object.- Returns:
- The border extent.
-
setOnClickListenner
public void setOnClickListenner(DynamicElement.OnClickListener listener)
Sets the clicking listener.- Parameters:
listener- Click listener.
-
addPoint
public void addPoint(Point2D pt)
Adds the point.- Parameters:
pt- Added points.
-
updatePoint
public void updatePoint(int index, Point2D pt)Updates the point.- Parameters:
index- Indexpt- New Point coordinates
-
addAnimator
public void addAnimator(Animator animator)
Adds the animation to the dynamic element. It can add mutiple animation.- Parameters:
animator- Dynamic element Animation
-
fromGeometry
public abstract boolean fromGeometry(Geometry geometry)
Create the dynamic data through Geometry.- Parameters:
geometry- Geographic elements- Returns:
- A boolean, Returns true if the constructor successful; Otherwise false.
-
setMinShowScale
public void setMinShowScale(double scale)
Sets the minimum display scale.- Parameters:
scale- Sets the minimum display scale.
-
getMinShowScale
public double getMinShowScale()
Gets the minimum display scale.- Returns:
- The minimum display scale.
-
setOnLongPressListener
public void setOnLongPressListener(DynamicElement.OnLongPressListener listener)
Sets the long-click listener.- Parameters:
listener- long-click listener.
-
getOnLongPressListener
public DynamicElement.OnLongPressListener getOnLongPressListener()
Gets the long-click listening of this object- Returns:
- The long-click listener.
-
setTag
public void setTag(java.lang.String tag)
Sets the label.- Parameters:
tag- Label.
-
getTag
public java.lang.String getTag()
Gets the label. Default value is null- Returns:
- Label.
-
setName
public void setName(java.lang.String name)
Sets the name of a dynamic object.- Parameters:
name- Name
-
getName
public java.lang.String getName()
Gets the name of the dynamic object, and the default problem null.- Returns:
- Name
-
setNameVisible
public void setNameVisible(boolean visible)
Sets whether the dynamic object name is visible, and is not visible by default.- Parameters:
visible- Whether it is visible.
-
isNameVisible
public boolean isNameVisible()
Gets whether the dynamic object name is visible, and the default false.- Returns:
- Whether it is visible.
-
setNameColor
public void setNameColor(int color)
Sets name font color, default black- Parameters:
color- The color value.
-
setNameSize
public void setNameSize(float size)
Sets name font size default 16pixel.- Parameters:
size- The size text.
-
getNameColor
public int getNameColor()
Gets the name font color.- Returns:
- The color value.
-
getNameSize
public float getNameSize()
Gets the name font size.- Returns:
- The name font size.
-
setNameTextAlign
public void setNameTextAlign(DynamicAlignment align)
Sets the name text to its method, the default center alignment.- Parameters:
align- Alignment
-
getNameTextAlign
public DynamicAlignment getNameTextAlign()
Gets the name text to its method, the default center alignment.- Returns:
- Alignment
-
setNamePosition
public void setNamePosition(Point2D position)
Sets the location of the name text.- Parameters:
position- Position coordinates, using map coordinates.
-
getNamePosition
public Point2D getNamePosition()
Gets the location coordinates of the name text, and if the user does not have the setting, the object center point is adopted by default.- Returns:
- Returns the position coordinate point Point2D, using the map coordinates.
-
dispose
public void dispose()
Disposes resources.
-
setNameOffsetX
public void setNameOffsetX(float offsetX)
Sets the X offset of the name text.- Parameters:
offsetX- Position offset
-
getNameOffsetX
public float getNameOffsetX()
- Parameters:
offsetX- Gets the X offset of the name text.- Returns:
- The X offset.
-
setNameOffsetY
public void setNameOffsetY(float offsetY)
Sets the Y offset of the name text.- Parameters:
offsetY- Position offset
-
getNameOffsetY
public float getNameOffsetY()
Gets the Y offset of the name text.- Returns:
- The Y offset.
-
getOnDownAndUpListener
public DynamicElement.OnDownAndUpListener getOnDownAndUpListener()
Gets the listener OnDownAndUpListener of the object- Returns:
- OnDownAndUpListener the listener
-
setOnDownAndUpListener
public void setOnDownAndUpListener(DynamicElement.OnDownAndUpListener listener)
Sets the listeners as fingers press down or leave dynamic objects.- Parameters:
listener- the listener for pressing down or leaving dynamic objects.
-
addPoints
public void addPoints(Point2Ds ps)
Add point set- Parameters:
pt-
-
-