public abstract class AbstractElement extends java.lang.Object implements java.awt.event.ActionListener, java.lang.Comparable<AbstractElement>, XmlOutputMethods, XmlInputMethods
Modifier and Type | Class and Description |
---|---|
static class |
AbstractElement.ELEMENT_TYPE |
Modifier and Type | Field and Description |
---|---|
LocationType |
centerLocation |
boolean |
copyChars |
protected static java.lang.String |
DEFAULT_ROOT_ELEMENT |
protected javax.swing.JDialog |
dialog |
protected org.dom4j.Document |
doc |
protected static LocationType |
guinea |
protected javax.swing.JCheckBox |
hiddenCheck |
protected java.lang.String |
id |
protected boolean |
isLoadOk |
protected javax.swing.JTextField |
objName |
boolean |
obstacle |
protected javax.swing.JCheckBox |
obstacleCheck |
protected ParametersPanel |
paramsPanel |
protected boolean |
selected |
java.lang.String[] |
takenNames |
protected javax.swing.JTextField |
transp |
protected int |
transparency |
boolean |
userCancel |
Constructor and Description |
---|
AbstractElement()
Creates a map element
|
AbstractElement(MapGroup mg,
MapType parentMap) |
AbstractElement(java.lang.String xml) |
Modifier and Type | Method and Description |
---|---|
void |
actionPerformed(java.awt.event.ActionEvent action)
The actions are triggered by the dialog created
for the object parameters
|
org.dom4j.Document |
asDocument() |
org.dom4j.Document |
asDocument(java.lang.String rootElementName) |
org.dom4j.Element |
asElement() |
org.dom4j.Element |
asElement(java.lang.String rootElementName) |
java.lang.String |
asXML()
Este problema foi resolvido com a versão 1.6.1 do DOM4J.
|
java.lang.String |
asXML(java.lang.String rootElementName)
Este problema foi resolvido com a versão 1.6.1 do DOM4J.
|
int |
compareTo(AbstractElement anotherMapObject) |
abstract boolean |
containsPoint(LocationType point,
StateRenderer2D renderer) |
LocationType |
getCenterLocation() |
AbstractElement |
getClone() |
abstract AbstractElement.ELEMENT_TYPE |
getElementType() |
java.lang.String |
getId() |
static java.util.Comparator |
getIDComparator() |
abstract int |
getLayerPriority()
Returns the showing priority for this object (0 normal, <0 background, >0 on top)
|
MapGroup |
getMapGroup() |
MissionType |
getMissionType() |
double[] |
getNEDPosition()
Returns the offset from absolute 0 as double[3]:
0 - The offset (in the North direction) from absolut (0,0,0)
1 - The offset (in the East direction) from absolut (0,0,0)
2 - The offset (in the Down direction) from absolut (0,0,0)
|
abstract ParametersPanel |
getParametersPanel(boolean editable,
MapType map) |
MapType |
getParentMap() |
double |
getPhi() |
double |
getPitch() |
double |
getPitchDeg() |
double |
getPitchRad() |
double |
getPsi() |
double |
getRoll() |
double |
getRollDeg() |
double |
getRollRad() |
java.util.Vector<LocationType> |
getShapePoints() |
double |
getTheta() |
double |
getTopHeight() |
int |
getTransparency() |
abstract java.lang.String |
getType() |
java.lang.String |
getTypeAbbrev() |
double |
getYaw() |
double |
getYawDeg() |
double |
getYawRad() |
abstract void |
initialize(ParametersPanel paramsPanel) |
java.awt.Color |
invertColor(java.awt.Color original)
Given a java.util.Color, returns its complementar color (negative)
|
boolean |
isFilled() |
boolean |
isLoadOk() |
boolean |
isObstacle() |
boolean |
isSelected() |
boolean |
isUserCancel() |
boolean |
load(org.dom4j.Element elem)
Should set
XmlInputMethods.isLoadOk() return value. |
boolean |
load(java.lang.String xml)
Should set
XmlInputMethods.isLoadOk() return value. |
abstract void |
paint(java.awt.Graphics2D g,
StateRenderer2D renderer,
double rotation) |
void |
setCenterLocation(LocationType centralLocation) |
void |
setFilled(boolean filled) |
void |
setId(java.lang.String id) |
void |
setMapGroup(MapGroup mapGroup) |
void |
setMissionType(MissionType missionType) |
void |
setObstacle(boolean obstacle) |
void |
setParentMap(MapType parentMap) |
void |
setPhi(double phi) |
void |
setPitch(double theta) |
void |
setPitchDeg(double pitch) |
void |
setPsi(double psi) |
void |
setRoll(double phi) |
void |
setRollDeg(double roll) |
void |
setSelected(boolean selected) |
void |
setTakenNames(java.lang.String[] takenNames)
Sets the currently taken object names (ids)
|
void |
setTheta(double theta) |
void |
setTransparency(int transparency) |
void |
setYaw(double psi) |
void |
setYawDeg(double yaw) |
void |
showParametersDialog(java.awt.Component parentComp,
java.lang.String[] takenNames,
MapType map,
boolean editable)
Creates a shows a parameters dialog for the current object
The user can chage the parameters of the current object here.
|
protected void |
showParametersDialog(java.awt.Component parentComp,
java.lang.String[] takenNames,
MapType map,
boolean editable,
boolean idEditable)
Creates a shows a parameters dialog for the current object
The user can chage the parameters of the current object here.
|
java.lang.String |
toString()
Returns the result of getName() - the default implementation returns the
field name
|
protected static final LocationType guinea
protected boolean isLoadOk
protected static final java.lang.String DEFAULT_ROOT_ELEMENT
protected int transparency
public LocationType centerLocation
public boolean obstacle
protected org.dom4j.Document doc
protected java.lang.String id
protected boolean selected
protected ParametersPanel paramsPanel
public boolean userCancel
public boolean copyChars
public java.lang.String[] takenNames
protected javax.swing.JDialog dialog
protected javax.swing.JCheckBox obstacleCheck
protected javax.swing.JCheckBox hiddenCheck
protected javax.swing.JTextField objName
protected javax.swing.JTextField transp
public AbstractElement()
public AbstractElement(java.lang.String xml)
xml
- public abstract void paint(java.awt.Graphics2D g, StateRenderer2D renderer, double rotation)
public abstract ParametersPanel getParametersPanel(boolean editable, MapType map)
public abstract void initialize(ParametersPanel paramsPanel)
public abstract boolean containsPoint(LocationType point, StateRenderer2D renderer)
public abstract AbstractElement.ELEMENT_TYPE getElementType()
public abstract int getLayerPriority()
public boolean isFilled()
public void setFilled(boolean filled)
filled
- the filled to setpublic boolean isLoadOk()
isLoadOk
in interface XmlInputMethods
public boolean load(java.lang.String xml)
XmlInputMethods
XmlInputMethods.isLoadOk()
return value.load
in interface XmlInputMethods
xml
- public boolean load(org.dom4j.Element elem)
XmlInputMethods
XmlInputMethods.isLoadOk()
return value.load
in interface XmlInputMethods
elem
- public java.lang.String asXML()
XmlOutputMethods
FileUtil.saveToFile(String, String)
e afins. Isto porque ao gravar como UTF-8
os caracteres são adulterados guardando por exemplo "é" em 2 caracteres (ou seja pega nos dois caracteres UTF-8 e
transforma-os em 2 UTF-8s).asXML
in interface XmlOutputMethods
public java.lang.String asXML(java.lang.String rootElementName)
XmlOutputMethods
FileUtil.saveToFile(String, String)
e afins. Isto porque ao gravar como UTF-8
os caracteres são adulterados guardando por exemplo "é" em 2 caracteres (ou seja pega nos dois caracteres UTF-8 e
transforma-os em 2 UTF-8s).asXML
in interface XmlOutputMethods
public org.dom4j.Element asElement()
asElement
in interface XmlOutputMethods
public org.dom4j.Element asElement(java.lang.String rootElementName)
asElement
in interface XmlOutputMethods
public org.dom4j.Document asDocument()
asDocument
in interface XmlOutputMethods
public org.dom4j.Document asDocument(java.lang.String rootElementName)
asDocument
in interface XmlOutputMethods
public java.lang.String getTypeAbbrev()
public abstract java.lang.String getType()
public int getTransparency()
public void setTransparency(int transparency)
transparency
- public double getPhi()
public void setPhi(double phi)
phi
- The phi to set.public double getRoll()
public void setRoll(double phi)
phi
- The phi to set.public double getTheta()
public void setTheta(double theta)
theta
- The theta to set.public double getPitch()
public void setPitch(double theta)
theta
- The theta to set.public double getPsi()
public void setPsi(double psi)
psi
- The psi to set.public double getYaw()
public void setYaw(double psi)
psi
- The psi to set.public void setRollDeg(double roll)
public void setPitchDeg(double pitch)
public void setYawDeg(double yaw)
public double getRollRad()
public double getPitchRad()
public double getYawRad()
public double getRollDeg()
public double getPitchDeg()
public double getYawDeg()
public boolean isObstacle()
public void setObstacle(boolean obstacle)
obstacle
- the obstacle to setpublic double getTopHeight()
public MapGroup getMapGroup()
public void setMapGroup(MapGroup mapGroup)
mapGroup
- public void setParentMap(MapType parentMap)
parentMap
- public MapType getParentMap()
public MissionType getMissionType()
public void setMissionType(MissionType missionType)
missionType
- public int compareTo(AbstractElement anotherMapObject)
compareTo
in interface java.lang.Comparable<AbstractElement>
public static java.util.Comparator getIDComparator()
public LocationType getCenterLocation()
public void setCenterLocation(LocationType centralLocation)
public java.lang.String getId()
public void setId(java.lang.String id)
id
- the id to setpublic java.lang.String toString()
toString
in class java.lang.Object
public boolean isSelected()
public void setSelected(boolean selected)
public void actionPerformed(java.awt.event.ActionEvent action)
actionPerformed
in interface java.awt.event.ActionListener
public void showParametersDialog(java.awt.Component parentComp, java.lang.String[] takenNames, MapType map, boolean editable)
takenNames
- protected void showParametersDialog(java.awt.Component parentComp, java.lang.String[] takenNames, MapType map, boolean editable, boolean idEditable)
takenNames
- public boolean isUserCancel()
public void setTakenNames(java.lang.String[] takenNames)
takenNames
- An array of String with the all the existing object names (ids)public java.awt.Color invertColor(java.awt.Color original)
original
- A java.util.Colorpublic java.util.Vector<LocationType> getShapePoints()
public double[] getNEDPosition()
- 0 - The offset (in the North direction) from absolut (0,0,0)
- 1 - The offset (in the East direction) from absolut (0,0,0)
- 2 - The offset (in the Down direction) from absolut (0,0,0)
public AbstractElement getClone() throws java.lang.Exception
java.lang.Exception
Copyright © 2004-2020 FEUP-LSTS and Neptus developers. All Rights Reserved.