Class Symbol

java.lang.Object
  |
  +--Symbol
All Implemented Interfaces:
Element, java.io.Serializable
Direct Known Subclasses:
Comp, Curve, PointSym, Section, Segment, Sub, Survey

public class Symbol
extends java.lang.Object
implements java.io.Serializable, Element

See Also:
Serialized Form

Field Summary
static boolean makenames
           
(package private)  java.lang.String name
          The name of the Symbol
All symbols have a name, which may be assignesd automatically, or set by the user.
(package private)  javax.swing.JTextField namefield
           
private static long serialVersionUID
           
 
Constructor Summary
Symbol()
           
Symbol(java.awt.geom.Point2D pos, View view, java.lang.Object arg)
           
Symbol(java.lang.String name)
           
 
Method Summary
 void abandonPropertyEdit()
           
 void acceptPropertyEdit()
           
(package private)  void checkName()
           
 void editProperties(java.util.Set sub, Symbol parent)
           
 void endDrag(int comand, java.awt.geom.Point2D pos, View view)
           
 java.awt.geom.Rectangle2D getBounds(java.awt.geom.AffineTransform trans)
           
 int getLevel()
           
 java.lang.String getName()
           
static Symbol getNew(java.lang.Class type, java.awt.geom.Point2D pos, View view, java.lang.Object arg)
           
 void getPropertyEdit(java.lang.Object[] edits, int slot, java.util.Set sub, Symbol parent)
           
 Symbol importSym(Carto dest, Carto source)
          Called when this Symbol is moved to a new Carto file.
Some Symbols hold references to parts of the old file.
 void paint(View view)
           
 void prepareForSurveyUpdate()
          Called just before a survey update.
Vector symbols that are tied (directly or indirectly through segments) to the survey need to know, so they can move with the survey.
private  void readObject(java.io.ObjectInputStream stream)
          Reads Symbol from a stream.
 boolean recursiveDelete(Symbol old)
          Delete all references to the given Symbol held by this one.
 boolean selectProbe(java.awt.geom.Point2D pos, View view)
           
 void setName(java.lang.String name)
           
 void showSelected(View view)
           
 boolean stripSurveys()
           
 java.lang.String toString()
           
 void useSurveyUpdate()
          Called when the survey has changed.
Symbols that move with the survey should do that now.
 boolean valid()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID

makenames

public static boolean makenames

name

java.lang.String name
The name of the Symbol
All symbols have a name, which may be assignesd automatically, or set by the user.


namefield

transient javax.swing.JTextField namefield
Constructor Detail

Symbol

public Symbol()

Symbol

public Symbol(java.lang.String name)

Symbol

public Symbol(java.awt.geom.Point2D pos,
              View view,
              java.lang.Object arg)
Method Detail

getNew

public static Symbol getNew(java.lang.Class type,
                            java.awt.geom.Point2D pos,
                            View view,
                            java.lang.Object arg)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

checkName

void checkName()

stripSurveys

public boolean stripSurveys()

getName

public java.lang.String getName()
Specified by:
getName in interface Element

setName

public void setName(java.lang.String name)
Specified by:
setName in interface Element

getBounds

public java.awt.geom.Rectangle2D getBounds(java.awt.geom.AffineTransform trans)

valid

public boolean valid()

selectProbe

public boolean selectProbe(java.awt.geom.Point2D pos,
                           View view)

showSelected

public void showSelected(View view)

paint

public void paint(View view)

endDrag

public void endDrag(int comand,
                    java.awt.geom.Point2D pos,
                    View view)

editProperties

public void editProperties(java.util.Set sub,
                           Symbol parent)

getLevel

public int getLevel()

getPropertyEdit

public void getPropertyEdit(java.lang.Object[] edits,
                            int slot,
                            java.util.Set sub,
                            Symbol parent)

acceptPropertyEdit

public void acceptPropertyEdit()

abandonPropertyEdit

public void abandonPropertyEdit()

importSym

public Symbol importSym(Carto dest,
                        Carto source)
Called when this Symbol is moved to a new Carto file.
Some Symbols hold references to parts of the old file. Get rid of them, and replace them with what they should be int the new context.


recursiveDelete

public boolean recursiveDelete(Symbol old)
Delete all references to the given Symbol held by this one.


prepareForSurveyUpdate

public void prepareForSurveyUpdate()
Called just before a survey update.
Vector symbols that are tied (directly or indirectly through segments) to the survey need to know, so they can move with the survey.


useSurveyUpdate

public void useSurveyUpdate()
Called when the survey has changed.
Symbols that move with the survey should do that now.


readObject

private void readObject(java.io.ObjectInputStream stream)
                 throws java.io.IOException,
                        java.lang.ClassNotFoundException
Reads Symbol from a stream. We define this method so it will appear in the stacktrace if something goes wrong. It does the default.

java.io.IOException
java.lang.ClassNotFoundException