carmetal.objects
Class SegmentObject

java.lang.Object
  extended by carmetal.objects.ConstructionObject
      extended by carmetal.objects.PrimitiveLineObject
          extended by carmetal.objects.TwoPointLineObject
              extended by carmetal.objects.SegmentObject
All Implemented Interfaces:
MoveableObject, PointonObject, carmetal.rene.lister.Element, carmetal.rene.util.sort.SortObject, Cloneable

public class SegmentObject
extends TwoPointLineObject


Field Summary
protected  boolean Fixed
           
 
Fields inherited from class carmetal.objects.TwoPointLineObject
P2
 
Fields inherited from class carmetal.objects.PrimitiveLineObject
DX, DY, P1, X1, Y1
 
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
SegmentObject(carmetal.construction.Construction c, PointObject p1, PointObject p2)
           
 
Method Summary
 boolean canFix()
           
 boolean canKeepClose()
           
 boolean contains(double x, double y)
          Test, if the projection of (x,y) to the line contains that point.
 Enumeration depending()
          Return an enumeration of objects, that this object depends on.
 boolean equals(ConstructionObject o)
           
 boolean fixed()
           
 String getDisplayValue()
          To be overridden by the objects.
 double getLength()
           
 int getN()
           
 int getSegmentCode()
           
 String getStringLength()
           
 String getTag()
           
 double getValue()
          Get the value of an object or throw an exception (e.g.
 boolean isArrow()
           
 boolean isValidFix()
           
 boolean moveable()
           
 boolean nearto(int c, int r, carmetal.rene.zirkel.ZirkelCanvas zc)
          see, if a point is on the segment or near to it.
 boolean onlynearto(int c, int r, carmetal.rene.zirkel.ZirkelCanvas zc)
          true, if the segment is too small.
 void paint(carmetal.rene.zirkel.graphics.MyGraphics g, carmetal.rene.zirkel.ZirkelCanvas zc)
           
 void printArgs(carmetal.rene.util.xml.XmlWriter xml)
           
 double project(double x, double y)
           
 void project(PointObject P)
           
 void project(PointObject P, double alpha)
           
 void round()
           
 void setArrow(boolean arrow)
           
 void setDefaults()
           
 void setFixed(boolean flag, String s)
           
 void setKeepClose(double x, double y)
           
 void setSegmentCode(int i)
           
 void setTargetDefaults()
           
 void translate()
          Override in children! This translates the mother items.
 void updateText()
           
 void validate()
           
 
Methods inherited from class carmetal.objects.TwoPointLineObject
contains, dragTo, getOldX, getOldY, getP2, move, secondaryParams, setP1P2, snap, startDrag
 
Methods inherited from class carmetal.objects.PrimitiveLineObject
addDep, canInteresectWith, clearCircleDep, getDistance, getDX, getDY, getEquation, getP1, getX, getY, intersect, intersect, intersect, isPartial, locallyLike, points, repulse, setP1DXDY, setPartial
 
Methods inherited from class carmetal.objects.ConstructionObject
addConditional, addDepInExpressions, canDisplayName, changedBy, checkConditionals, clearConditional, clearConditionals, clearParameter, compare, copy, copyProperties, dependsOn, depset, depset, depset, discardMV, displays, drawCenteredLabel, drawLabel, drawLabel, drawPointLabel, edit, equals, equalsTo, getAlias, getCDPDisplayValue, getCDPSizeDisplay, getColor, getColorIndex, getColorIndex, getColorType, getColorType, getConditional, getConditionalColor, getConstruction, getDepArray, getDescription, getDisplaySize, getDisplayText, getE, getElementColor, getElementString, getElementString, getEX, getEXpos, getExpression, getEY, getEYpos, getIncrement, getLines, getMax, getMin, getName, getNCount, getObtuse, getPointObject, getPrompt, getR, getSpecialColor, getText, getTranslation, getType, getUnit, getVector, getZ, hasUnit, haveConditional, haveConditionals, helpDisplayNumber, helpDisplayValue, indicated, isBack, isBack, isBold, isBreak, isBreakHide, isDragable, isDriverObject, isFilled, isFilledForSelect, isFixed, isFlag, isGotNCount, isHidden, isHidden, isHideBreak, isInConstruction, isInside, isJobTarget, isKeep, isKeepClose, isLarge, isMainParameter, isOwnedByControl, isParameter, isRekFlag, isSelectable, isSlider, isSolid, isSolid, isSpecial, isSpecialParameter, isStrongSelected, isSuperHidden, isSuperHidden, isTarget, labelSelected, laterBind, laterTranslate, maybeTransparent, mustHide, nearto, replaceExpressions, round, round, roundDisplay, save, selected, setAlias, setBack, setBold, setBreak, setBreakHide, setcOffset, setColor, setColor, setColorType, setConstruction, setDisplaySize, setDragable, setExpression, setFilled, setFixed, setFixed, setFixed, setFlag, setFont, setGotNCount, setHidden, setHideBreak, setInConstruction, setIncrement, setIndicated, setIndicated, setInside, setJobTarget, setKeep, setKeepClose, setLabelSelected, setLarge, setLines, setMainParameter, setName, setName, setNameCheck, setNameWithNumber, setNCount, setObtuse, setOffset, setOwnedByControl, setParameter, setPrompt, setRekFlag, setSelectable, setSelected, setShowName, setShowValue, setSlider, setSlider, setSolid, setSpecial, setSpecialColor, setSpecialParameter, setStrongSelected, setSuperHidden, setTarget, setText, setText, setTracked, setTranslation, setType, setUnit, showName, showName, showValue, showValue, 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

Fixed

protected boolean Fixed
Constructor Detail

SegmentObject

public SegmentObject(carmetal.construction.Construction c,
                     PointObject p1,
                     PointObject p2)
Method Detail

getTag

public String getTag()
Overrides:
getTag in class PrimitiveLineObject

getN

public int getN()
Overrides:
getN in class ConstructionObject

setDefaults

public void setDefaults()
Overrides:
setDefaults in class PrimitiveLineObject

setTargetDefaults

public void setTargetDefaults()
Overrides:
setTargetDefaults in class PrimitiveLineObject

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 PrimitiveLineObject

canKeepClose

public boolean canKeepClose()
Overrides:
canKeepClose in class PrimitiveLineObject

setKeepClose

public void setKeepClose(double x,
                         double y)
Overrides:
setKeepClose in class PrimitiveLineObject

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.

nearto

public boolean nearto(int c,
                      int r,
                      carmetal.rene.zirkel.ZirkelCanvas zc)
see, if a point is on the segment or near to it.

Overrides:
nearto in class PrimitiveLineObject

onlynearto

public boolean onlynearto(int c,
                          int r,
                          carmetal.rene.zirkel.ZirkelCanvas zc)
true, if the segment is too small.

Overrides:
onlynearto in class PrimitiveLineObject

printArgs

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

getLength

public double getLength()
Overrides:
getLength in class TwoPointLineObject

fixed

public boolean fixed()
Overrides:
fixed in class ConstructionObject

setFixed

public void setFixed(boolean flag,
                     String s)
              throws carmetal.construction.ConstructionException
Overrides:
setFixed in class ConstructionObject
Throws:
carmetal.construction.ConstructionException

round

public void round()
Overrides:
round in class ConstructionObject

canFix

public boolean canFix()
Overrides:
canFix in class ConstructionObject
Returns:
Segment can be fixed in length.

contains

public boolean contains(double x,
                        double y)
Description copied from class: PrimitiveLineObject
Test, if the projection of (x,y) to the line contains that point.

Overrides:
contains in class PrimitiveLineObject

project

public double project(double x,
                      double y)
Overrides:
project in class PrimitiveLineObject

equals

public boolean equals(ConstructionObject o)
Overrides:
equals in class PrimitiveLineObject
Returns:
true, if equal.

isValidFix

public boolean isValidFix()

getStringLength

public String getStringLength()
Overrides:
getStringLength in class ConstructionObject

getSegmentCode

public int getSegmentCode()

setSegmentCode

public void setSegmentCode(int i)

getValue

public double getValue()
                throws carmetal.construction.ConstructionException
Description copied from class: ConstructionObject
Get the value of an object or throw an exception (e.g. if invalid). Not all objects have a value.

Overrides:
getValue in class ConstructionObject
Throws:
carmetal.construction.ConstructionException

translate

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

Overrides:
translate in class TwoPointLineObject

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 TwoPointLineObject

setArrow

public void setArrow(boolean arrow)

isArrow

public boolean isArrow()

project

public void project(PointObject P)
Specified by:
project in interface PointonObject
Overrides:
project in class PrimitiveLineObject

project

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

moveable

public boolean moveable()
Specified by:
moveable in interface MoveableObject
Overrides:
moveable in class TwoPointLineObject


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