carmetal.objects
Class TrackObject

java.lang.Object
  extended by carmetal.objects.ConstructionObject
      extended by carmetal.objects.TrackObject
All Implemented Interfaces:
PointonObject, carmetal.rene.lister.Element, carmetal.rene.util.sort.SortObject, Cloneable
Direct Known Subclasses:
JLocusTrackObject

public class TrackObject
extends ConstructionObject
implements PointonObject

This object contains an automatic track. It is saved in the construction like any other ConstructionObject. Validation is time consuming and is done only on repaints from ZirkelCanvas.


Field Summary
 double da
           
 boolean Discrete
           
 double DMin
           
 boolean DontProject
           
 double DX
           
 double DY
           
 boolean Filled
           
 boolean Fixed
           
 ConstructionObject O
           
 ConstructionObject P
           
 carmetal.rene.zirkel.graphics.PolygonFiller PF
           
 PointObject PM
           
 int PMax
           
 int PN
           
 ConstructionObject[] PO
           
 boolean StartFix
           
 double StepSize
           
 int Type
           
 Vector V
           
 Vector[] VO
           
 double X
           
 double Y
           
 
Fields inherited from class carmetal.objects.ConstructionObject
Back, Bold, Break, BreakHide, C, Cn, ColorIndex, ColorType, Conditionals, Count, DescriptionState, DisplaysText, DL, Flag, FormulaState, gotNCount, HasZ, Hidden, HideBreak, inConstruction, Indicated, INVISIBLE, IsDrawn, JobTarget, Keep, KeepClose, LabelSelected, Large, MainParameter, Name, NCount, NeedsRecompute, NORMAL, Obtuse, Parameter, RekFlag, RekValidating, Scratch, Selectable, Selected, ShowIndicatedName, ShowName, ShowValue, SizeState, Solid, SpecialColor, SpecialParameter, StrongSelected, SuperHidden, Target, Text, THICK, THIN, Tracked, Translation, TX1, TX2, TY1, TY2, Unit, Valid, Value, VRek, XcOffset, YcOffset
 
Constructor Summary
TrackObject(carmetal.construction.Construction c)
           
TrackObject(carmetal.construction.Construction c, ConstructionObject p, ConstructionObject[] po, int pn, ConstructionObject o, PointObject pm)
           
 
Method Summary
 void addCoordinates(Vector v, ConstructionObject p)
           
 void addCoordinates(Vector v, ConstructionObject p, double x, double y)
           
 void addCoordinates(Vector v, double x, double y)
           
 void addSecondary(boolean[] startedO)
           
 boolean canDisplayName()
           
 boolean canInteresectWith(ConstructionObject o)
           
 void compute(carmetal.rene.zirkel.ZirkelCanvas zc)
           
 Enumeration depending()
          Return an enumeration of objects, that this object depends on.
 void docompute(carmetal.rene.zirkel.ZirkelCanvas zc)
          Complicated procedure to recompute the automatic track.
 boolean equals(ConstructionObject o)
           
 String getDisplayValue()
          To be overridden by the objects.
 int getDistance(PointObject P)
           
 double getDMin()
           
 double getLength()
           
 int getN()
           
 double getSum()
           
 double getSum(double x, double y)
           
 String getTag()
           
 int getType()
           
 boolean hasUnit()
           
 boolean isDiscrete()
           
 boolean isFilled()
           
 boolean isFixed()
           
 boolean maybeTransparent()
           
 double mod(double x)
           
 boolean nearto(int x, int y, carmetal.rene.zirkel.ZirkelCanvas zc)
          Test, if this object is chosen with coordinates x,y
 boolean onlynearto(int c, int r, carmetal.rene.zirkel.ZirkelCanvas zc)
          Test, if this object must be chosen with coordinates x,y, assuming it is near to these coordinates.
 void paint(carmetal.rene.zirkel.graphics.MyGraphics g, carmetal.rene.zirkel.ZirkelCanvas zc)
           
 void printArgs(carmetal.rene.util.xml.XmlWriter xml)
           
 void printType(carmetal.rene.util.xml.XmlWriter xml)
           
 void project(PointObject P)
          Project a point to this object.
 void project(PointObject P, double alpha)
           
 void repulse(PointObject P)
           
 void setDefaults()
           
 void setDiscrete(boolean discrete)
           
 void setDMin(double dmin)
           
 void setFilled(boolean flag)
           
 void setFixed(boolean f)
           
 void setTargetDefaults()
           
 void setType(int type)
           
 void translate()
          Override in children! This translates the mother items.
 double updateDA(double da, boolean valid, double dist, double dp, double dmin, double dmax, carmetal.rene.zirkel.ZirkelCanvas zc)
           
 void updateText()
           
 void validate()
           
 
Methods inherited from class carmetal.objects.ConstructionObject
addConditional, addDepInExpressions, canFix, canKeepClose, changedBy, checkConditionals, clearCircleDep, clearConditional, clearConditionals, clearParameter, compare, contains, copy, copyProperties, dependsOn, depset, depset, depset, discardMV, displays, drawCenteredLabel, drawLabel, drawLabel, drawPointLabel, edit, equals, equalsTo, fixed, getAlias, getCDPDisplayValue, getCDPSizeDisplay, getColor, getColorIndex, getColorIndex, getColorType, getColorType, getConditional, getConditionalColor, getConstruction, getDepArray, getDescription, getDisplaySize, getDisplayText, getE, getElementColor, getElementString, getElementString, getEquation, getEX, getEXpos, getExpression, getEY, getEYpos, getIncrement, getLines, getMax, getMin, getName, getNCount, getObtuse, getPointObject, getPrompt, getR, getSpecialColor, getStringLength, getText, getTranslation, getUnit, getValue, getVector, getX, getY, getZ, haveConditional, haveConditionals, helpDisplayNumber, helpDisplayValue, indicated, isBack, isBack, isBold, isBreak, isBreakHide, isDragable, isDriverObject, isFilledForSelect, isFlag, isGotNCount, isHidden, isHidden, isHideBreak, isInConstruction, isInside, isJobTarget, isKeep, isKeepClose, isLarge, isMainParameter, isOwnedByControl, isParameter, isPartial, isRekFlag, isSelectable, isSlider, isSolid, isSolid, isSpecial, isSpecialParameter, isStrongSelected, isSuperHidden, isSuperHidden, isTarget, labelSelected, laterBind, laterTranslate, locallyLike, move, mustHide, nearto, replaceExpressions, round, round, round, roundDisplay, save, secondaryParams, selected, setAlias, setBack, setBold, setBreak, setBreakHide, setcOffset, setColor, setColor, setColorType, setConstruction, setDisplaySize, setDragable, setExpression, setFixed, setFixed, setFixed, setFlag, setFont, setGotNCount, setHidden, setHideBreak, setInConstruction, setIncrement, setIndicated, setIndicated, setInside, setJobTarget, setKeep, setKeepClose, setKeepClose, setLabelSelected, setLarge, setLines, setMainParameter, setName, setName, setNameCheck, setNameWithNumber, setNCount, setObtuse, setOffset, setOwnedByControl, setParameter, setPartial, setPrompt, setRekFlag, setSelectable, setSelected, setShowName, setShowValue, setSlider, setSlider, setSolid, setSpecial, setSpecialColor, setSpecialParameter, setStrongSelected, setSuperHidden, setTarget, setText, setText, setTracked, setTranslation, setUnit, showName, showName, showValue, showValue, snap, testConditional, text1, text2, text3, text4, textAny, textcontains, toggleHidden, tracked, translateConditionals, translateExpressions, translateOffset, updateCircleDep, valid, visible, xcOffset, ycOffset
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PM

public PointObject PM

O

public ConstructionObject O

P

public ConstructionObject P

PMax

public int PMax

PN

public int PN

PO

public ConstructionObject[] PO

Filled

public boolean Filled

Discrete

public boolean Discrete

Type

public int Type

PF

public carmetal.rene.zirkel.graphics.PolygonFiller PF

V

public Vector V

VO

public Vector[] VO

da

public double da

X

public double X

Y

public double Y

DX

public double DX

DY

public double DY

DontProject

public boolean DontProject

DMin

public double DMin

StepSize

public double StepSize

Fixed

public boolean Fixed

StartFix

public boolean StartFix
Constructor Detail

TrackObject

public TrackObject(carmetal.construction.Construction c)

TrackObject

public TrackObject(carmetal.construction.Construction c,
                   ConstructionObject p,
                   ConstructionObject[] po,
                   int pn,
                   ConstructionObject o,
                   PointObject pm)
Method Detail

setFilled

public void setFilled(boolean flag)
Overrides:
setFilled in class ConstructionObject

isFilled

public boolean isFilled()
Overrides:
isFilled in class ConstructionObject

setDefaults

public void setDefaults()
Overrides:
setDefaults in class ConstructionObject

setTargetDefaults

public void setTargetDefaults()
Overrides:
setTargetDefaults in class ConstructionObject

getTag

public String getTag()
Overrides:
getTag in class ConstructionObject

getN

public int getN()
Overrides:
getN in class ConstructionObject

updateText

public void updateText()
Overrides:
updateText in class ConstructionObject

validate

public void validate()
Overrides:
validate in class ConstructionObject

paint

public void paint(carmetal.rene.zirkel.graphics.MyGraphics g,
                  carmetal.rene.zirkel.ZirkelCanvas zc)
Overrides:
paint in class ConstructionObject

getSum

public double getSum(double x,
                     double y)
              throws carmetal.construction.ConstructionException
Throws:
carmetal.construction.ConstructionException

getSum

public double getSum()
              throws carmetal.construction.ConstructionException
Throws:
carmetal.construction.ConstructionException

getLength

public double getLength()
                 throws carmetal.construction.ConstructionException
Throws:
carmetal.construction.ConstructionException

printArgs

public void printArgs(carmetal.rene.util.xml.XmlWriter xml)
Overrides:
printArgs in class ConstructionObject

printType

public void printType(carmetal.rene.util.xml.XmlWriter xml)

depending

public Enumeration depending()
Description copied from class: ConstructionObject
Return an enumeration of objects, that this object depends on. This should usually called from children via super.

Overrides:
depending in class ConstructionObject

equals

public boolean equals(ConstructionObject o)
Overrides:
equals in class ConstructionObject

translate

public void translate()
Description copied from class: ConstructionObject
Override in children! This translates the mother items.

Overrides:
translate in class ConstructionObject

maybeTransparent

public boolean maybeTransparent()
Overrides:
maybeTransparent in class ConstructionObject

nearto

public boolean nearto(int x,
                      int y,
                      carmetal.rene.zirkel.ZirkelCanvas zc)
Description copied from class: ConstructionObject
Test, if this object is chosen with coordinates x,y

Overrides:
nearto in class ConstructionObject

onlynearto

public boolean onlynearto(int c,
                          int r,
                          carmetal.rene.zirkel.ZirkelCanvas zc)
Description copied from class: ConstructionObject
Test, if this object must be chosen with coordinates x,y, assuming it is near to these coordinates.

Overrides:
onlynearto in class ConstructionObject

mod

public double mod(double x)

docompute

public void docompute(carmetal.rene.zirkel.ZirkelCanvas zc)
Complicated procedure to recompute the automatic track. In principle, a moving point moves on some object, the coordinates of the tracked points or the intersections of the tracked lines are stored, as well as the positions of the moved point. But if the tracked point gets invalid, the movement reverses and the interesections change. Moreover, there is a list of secondary tracked objects.

Parameters:
zc -

compute

public void compute(carmetal.rene.zirkel.ZirkelCanvas zc)

addSecondary

public void addSecondary(boolean[] startedO)

addCoordinates

public void addCoordinates(Vector v,
                           ConstructionObject p,
                           double x,
                           double y)

addCoordinates

public void addCoordinates(Vector v,
                           ConstructionObject p)

addCoordinates

public void addCoordinates(Vector v,
                           double x,
                           double y)

updateDA

public double updateDA(double da,
                       boolean valid,
                       double dist,
                       double dp,
                       double dmin,
                       double dmax,
                       carmetal.rene.zirkel.ZirkelCanvas zc)

hasUnit

public boolean hasUnit()
Overrides:
hasUnit in class ConstructionObject

project

public void project(PointObject P)
Project a point to this object.

Specified by:
project in interface PointonObject

getDistance

public int getDistance(PointObject P)
Overrides:
getDistance in class ConstructionObject

getDisplayValue

public String getDisplayValue()
Description copied from class: ConstructionObject
To be overridden by the objects.

Overrides:
getDisplayValue in class ConstructionObject
Returns:
The string to display the value (length, coordinates) of the object.

project

public void project(PointObject P,
                    double alpha)
Specified by:
project in interface PointonObject

canDisplayName

public boolean canDisplayName()
Overrides:
canDisplayName in class ConstructionObject

isFixed

public boolean isFixed()
Overrides:
isFixed in class ConstructionObject

setFixed

public void setFixed(boolean f)
Overrides:
setFixed in class ConstructionObject

setDMin

public void setDMin(double dmin)

getDMin

public double getDMin()

getType

public int getType()
Overrides:
getType in class ConstructionObject

setType

public void setType(int type)
Overrides:
setType in class ConstructionObject

isDiscrete

public boolean isDiscrete()

setDiscrete

public void setDiscrete(boolean discrete)

canInteresectWith

public boolean canInteresectWith(ConstructionObject o)
Specified by:
canInteresectWith in interface PointonObject

repulse

public void repulse(PointObject P)
Specified by:
repulse in interface PointonObject


© Copyright 2005 S.Chekanov. All Rights Reserved.
jHPlot package, a part of jHepWork: is a full-featured multiplatform data-analysis framework