Back to index

wims  3.65+svn20090927
Public Member Functions | Public Attributes | Static Public Attributes | Package Functions | Package Attributes | Static Package Attributes
rene.zirkel.ZirkelCanvas Class Reference
Inheritance diagram for rene.zirkel.ZirkelCanvas:
Inheritance graph
[legend]
Collaboration diagram for rene.zirkel.ZirkelCanvas:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 ZirkelCanvas (boolean readonly, boolean replay, boolean hidden)
 Initiate an empty construction.
 ZirkelCanvas (boolean readonly)
 ZirkelCanvas ()
Dimension getMinimumSize ()
Dimension getPreferredSize ()
void updateDigits ()
void itemStateChanged (ItemEvent e)
void setZirkelCanvasListener (ZirkelCanvasInterface zci)
String loadImage ()
Image doLoadImage (String filename)
void actionPerformed (ActionEvent e)
double col (double x)
double row (double y)
int width ()
int height ()
double x (int c)
double y (int r)
double dx (int c)
double dy (int r)
double dx (double c)
double dy (double r)
double maxX ()
double minX ()
double maxY ()
double minY ()
boolean isInside (double x, double y)
double dCenter (double x, double y)
void recompute ()
void setDoneListener (DoneListener dl)
void addObject (ConstructionObject o)
 Add an item to the construction and re-paint the construction.
void added (Construction c, ConstructionObject o)
 A construction added an item.
boolean check (Construction c)
void check ()
 Check if the solution to the current problem has been found.
synchronized void mousePressed (MouseEvent e)
synchronized void mouseReleased (MouseEvent e)
synchronized void mouseClicked (MouseEvent e)
synchronized void mouseExited (MouseEvent e)
void mouseEntered (MouseEvent e)
synchronized void mouseMoved (MouseEvent e)
synchronized void mouseDragged (MouseEvent e)
synchronized void doMouseDragged (MouseEvent e)
void newImage ()
void setFrozen (boolean f)
synchronized void paint (Graphics g)
synchronized void resetGraphics ()
void updateBreakHide ()
void setGrid ()
double pointSize ()
double selectionSize ()
int scale (int x)
String format (double x)
void update (Graphics g)
void paintUntil (ConstructionObject o)
void validate ()
synchronized void dovalidate ()
 Synchronized update of the construction to avoid a repaint during update.
void sort (MyVector V)
void sortRow (MyVector V)
 Slow function to resort a vector by the number of each element in the construction.
ConstructionObject selectCircleLine (int x, int y, boolean multiple)
 select a circle or a line.
ConstructionObject selectCircleLine (int x, int y)
ConstructionObject selectPointonObject (int x, int y, boolean multiple)
 select a circle or a line.
ConstructionObject selectPointonObject (int x, int y)
MyVector selectCircleLineObjects (int x, int y, boolean multiple, boolean testlocal)
 Select all possible circles or lines at x,y.
MyVector selectCircleLineObjects (int x, int y, boolean multiple)
MyVector selectCircleLineObjects (int x, int y)
MyVector selectPointonObjects (int x, int y, boolean multiple, boolean testlocal)
 Select all possible object at x,y that can carry a point.
MyVector selectPointonObjects (int x, int y, boolean multiple)
MyVector selectPointonObjects (int x, int y)
MyVector selectObjects (int x, int y, boolean multiple)
 Select all selectable objects near to x,y.
MyVector selectObjects (int x, int y)
ConstructionObject selectObject (int x, int y, boolean multiple)
 Select a single object near x,y.
ConstructionObject selectObject (int x, int y)
MyVector selectConstructableObjects (int x, int y, boolean multiple)
 select all constructable objects near x,y.
MyVector selectConstructableObjects (int x, int y)
ConstructionObject selectConstructableObject (int x, int y)
 select a single constructable object near x,y.
PrimitiveLineObject selectLine (int x, int y, boolean multiple)
 Select a single line, segment, ray, perp., paral.
void selectLineObjects (int x, int y, boolean multiple)
PrimitiveLineObject selectLine (int x, int y)
void selectPointsOrLines (int x, int y, boolean multiple)
 Select a point or a line (for the object tracker).
TwoPointLineObject selectTwoPointLine (int x, int y, boolean multiple)
 Select a single line, segment, or ray near x,y.
void selectTwoPointLines (int x, int y, boolean multiple)
TwoPointLineObject selectTwoPointLine (int x, int y)
SegmentObject selectSegment (int x, int y, boolean multiple)
 Select a single segment near x,y.
void selectSegments (int x, int y, boolean multiple)
SegmentObject selectSegment (int x, int y)
RayObject selectRay (int x, int y, boolean multiple)
 Select a single ray near x,y.
void selectRays (int x, int y, boolean multiple)
RayObject selectRay (int x, int y)
PrimitiveCircleObject selectCircle (int x, int y, boolean multiple)
 Select a circle near x,y.
void selectCircles (int x, int y, boolean multiple)
PrimitiveCircleObject selectCircle (int x, int y)
PointObject selectPoint (int x, int y, boolean multiple)
 Select a point near x,y.
void selectPointObjects (int x, int y, boolean multiple)
PointObject selectPoint (int x, int y)
PointObject selectPoint (int x, int y, boolean multiple, ConstructionObject until)
void selectPointObjects (int x, int y, boolean multiple, ConstructionObject until)
PointObject selectPoint (int x, int y, ConstructionObject until)
boolean isNewPoint ()
PointObject selectCreatePoint (int x, int y, boolean multiple, boolean any)
 Select a point, and create a new point, if necessary.
ConstructionObject tryCreateIntersection (int x, int y, boolean ask)
PointObject selectCreatePoint (int x, int y)
PointObject selectCreatePoint (int x, int y, boolean multiple)
ConstructionObject selectMoveablePoint (int x, int y)
 Select a moveable point at x,y.
ConstructionObject selectWithSelector (int x, int y, Selector sel, ConstructionObject until, boolean choice)
 Select a point with a selector, provided by the calling constructor.
ConstructionObject selectWithSelector (int x, int y, Selector sel, ConstructionObject until)
ConstructionObject selectWithSelector (int x, int y, Selector sel, boolean choice)
ConstructionObject selectWithSelector (int x, int y, Selector sel)
ConstructionObject selectImmediateMoveablePoint (int x, int y)
 Select a moveable point at x,y.
ConstructionObject selectMoveableObject (int x, int y)
 Select a moveable object at x,y.
void selectMoveableObjects (int x, int y, boolean control)
void selectMoveableObjects (int x, int y)
ConstructionObject selectImmediateMoveableObject (int x, int y)
 Select a moveable object at x,y.
void filter (MyVector v, int x, int y, boolean choice)
 try to determine the unique objects that are near coordinates x,y and delete all others from the vector v.
void filter (MyVector v, int x, int y)
ConstructionObject select (MyVector v, int x, int y, boolean choice)
 user must select an object in the selection dialog, unless the selection is unique anyway, or the filter determines that the selection is unique.
ConstructionObject select (MyVector v, int x, int y)
ConstructionObject select (MyVector v, boolean choice)
 user must select an object in the selection dialog, unless the selection is unique anyway.
ConstructionObject select (MyVector v)
ConstructionObject selectLabel (int x, int y)
 select the label of a point, i.e.
ConstructionObject findSelectedObject ()
void indicate (MyVector v, boolean showname)
void indicate (MyVector v)
void clearIndicated ()
void movePreview (MouseEvent e)
void prepareForPreview (MouseEvent e)
boolean isPreview ()
void clearPreview ()
void setPreviewObject (MoveableObject o)
ConstructionObject indicateTryCreateIntersection (int x, int y, boolean ask)
void indicateCreatePoint (int x, int y, boolean multiple)
void indicateCircleLineObjects (int x, int y)
void indicatePointonObjects (int x, int y)
void indicateIntersectedObjects (int x, int y)
void indicateLineObjects (int x, int y)
void indicatePointObjects (int x, int y)
void indicatePointObjects (int x, int y, ConstructionObject until)
void indicatePointsOrLines (int x, int y)
void indicateSegments (int x, int y)
void indicateRays (int x, int y)
void indicateTwoPointLines (int x, int y)
void indicateCircles (int x, int y)
void indicateMoveableObjects (int x, int y, boolean control)
void indicateMoveableObjects (int x, int y)
void indicateWithSelector (int x, int y, Selector sel)
void indicateWithSelector (int x, int y, Selector sel, ConstructionObject until)
void indicateConstructableObjects (int x, int y)
void indicateObjects (int x, int y, boolean showname)
void indicateObjects (int x, int y)
void setTool (ObjectConstructor oc)
void setSuddenTool (ObjectConstructor oc)
void reset ()
void clearSelected ()
synchronized void clear ()
synchronized void back ()
 Delete last construction step done by user (highest number) and all non-visible steps before it.
synchronized void undo ()
void delete (ConstructionObject o)
void delete (Vector v)
 Delete a vector of construction objects.
boolean depends (ConstructionObject o, ConstructionObject on)
void addStatusListener (StatusListener sl)
void showStatus (String s)
void showStatus ()
boolean showHidden ()
void setDefaultColor (int c)
int getDefaultColor ()
void setDefaultType (int c)
int getDefaultType ()
void setPartial (boolean flag)
boolean getPartial ()
void setRestricted (boolean flag)
boolean getRestricted ()
void setPartialLines (boolean flag)
boolean getPartialLines ()
void setVectors (boolean flag)
boolean getVectors ()
void setLongNames (boolean flag)
boolean getLongNames ()
void setLargeFont (boolean flag)
boolean getLargeFont ()
void setBoldFont (boolean flag)
boolean getBoldFont ()
void setObtuse (boolean flag)
boolean getObtuse ()
void setSolid (boolean flag)
boolean getSolid ()
void setShowNames (boolean flag)
boolean getShowNames ()
void setShowValues (boolean flag)
boolean getShowValues ()
void setDefaultColorType (int c)
int getDefaultColorType ()
void setShowHidden (boolean flag)
boolean getShowHidden ()
void setHidden (boolean flag)
boolean hides (ConstructionObject o)
 With this it is possible to hide all non-constructable items.
void save (OutputStream o, boolean construction, boolean macros, boolean protectedmacros, Vector Macros, String Restrict) throws IOException
 Save the construction in this canvas in XML form to the specified output stream.
void load (InputStream in, boolean construction, boolean macros) throws Exception
void resetSum ()
void warning (String s, String help)
void warning (String s)
void load (InputStream in) throws Exception
String getComment ()
void setComment (String s)
String getJobComment ()
void setJobComment (String s)
void setFrame (Frame f)
 This can be used to set a frame window for the error dialogs that the canvas my display.
Frame getFrame ()
void magnify (double f)
 Maginify the view by the specified factor.
void shift (double dx, double dy)
 Shift the view with these deltas.
void paintTrack (MyGraphics g)
 Tracker routines: Call the OC (must be a TrackPainter) to paint the object track.
void updateTexts (ConstructionObject o, String oldname)
 Run through the construction to update all object texts.
Construction getConstruction ()
void setShowGrid (boolean flag)
void toggleShowGrid ()
boolean showGrid ()
void setJob (ConstructionObject last)
 Sets the job parameters for the current construction (the last item to display and the target item).
void addJobTarget (ConstructionObject target, boolean visible)
void clearTargets ()
void clearJob ()
 Cancel the job state o fthe current construction.
boolean isJob ()
 Test, if the construction is a valid job.
boolean inTargets (String s)
void displayJob (boolean flag)
 This will display the construction as a job (if it is a job).
void freeJob ()
 If the job is solved, this function removes all restrictions.
boolean displayJob ()
 Test if the canvas displays a job right now.
void setShowColor (int i)
int getShowColor ()
ObjectConstructor getOC ()
Vector getMacros ()
boolean haveMacros ()
boolean haveNonprotectedMacros ()
Macro copyMacro (Macro m, String name, boolean fixed[])
 Copy a macro with fixed parameters from another macro.
void defineMacro (Construction c, Macro m, boolean targetsonly, boolean superhide, String prompt[], boolean hideduplicates) throws ConstructionException
 Define a macro based on a construction in c and the targets and parameters in this construction.
boolean needed (Construction c, ConstructionObject o, ConstructionObject besides)
 See, if this secondary parameter "o" is needed in the construction "c" by either a constructable object, or a parameter different from "besides".
boolean canConvert (Construction c, TwoPointLineObject o)
 See, if this two point line can be converted to a primitive line.
void defineMacro (String name, String comment, Construction c) throws ConstructionException
 Define a macro from the information stored in the construction c, and store it to the macros in this ZirkelCanvas object.
void storeMacro (Macro m, boolean all)
void appendMacro (Macro m)
boolean replaceMacro (Macro m, int i, boolean all)
 Replace the macro item number i with m.
Macro chooseMacro ()
 The user has to choose from a list of macros (for running).
Vector chooseMacros ()
 The user can choose from a list of macros (for saving).
Macro chooseMacro (String name)
 Run a macro by name.
void deleteMacros (Vector v)
void deleteMacro (MacroItem m)
void clearMacros ()
void clearNonprotectedMacros ()
void clearProtectedMacros ()
void protectMacros ()
void renameMacro (Macro macro, String name)
void setMacroBar (MacroBar m)
void updateMacroBar ()
void setTextField (TextField t)
void setPrompt (String s)
void loadRun (InputStream is)
void loadMacro (BufferedReader in, String name) throws ConstructionException
double getGridSize ()
synchronized void print (Graphics g, int W, int H)
LatexOutput createBB (String filename, int w, int h, double dpi)
synchronized boolean savePNG (String filename, boolean latex)
 Save picture as PNG on file or copy to clipboard.
void savePreviewAsPNG (String filename)
void saveFIG (String filename)
void saveSVG (String filename)
void savePDF (String filename)
void saveEPS (String filename)
void returnPressed ()
 Return pressed.
void bind (PointObject p)
void setAway (IntersectionObject p, boolean away)
void setCurveCenter (FunctionObject p)
void range (PrimitiveCircleObject c)
void set (FixedAngleObject a)
void set (FixedCircleObject c)
boolean enabled (String function)
void pause (boolean flag)
void setReadOnly (boolean flag)
void allowRightMouse (boolean flag)
boolean changed ()
void grab (boolean flag)
 Create a background image for the Movertool, consisting of the current construction.
void setBackground (Image i)
void setInteractive (boolean flag)
ObjectConstructor getCurrentTool ()
synchronized void addDrawing (Drawing d)
synchronized void clearDrawings ()
synchronized void paintDrawings (MyGraphics g)
void saveDrawings (XmlWriter xml)
void loadDrawings (XmlTree tree) throws ConstructionException
void renameABC (ConstructionObject o, boolean enforce, boolean reset)
void selectAllMoveableVisibleObjects ()
void hideDuplicates (ConstructionObject from)
void hideDuplicates ()
void createCurve ()
void createFunction ()
void editLast ()
void breakpointLast (boolean flag, boolean hiding)
void notifyChanged ()
void startWaiting ()
void endWaiting ()
void showMessage (String s)
void hideMessage ()
void setHotEqn (String s)
int paintHotEqn (int c, int r, Graphics g)
void reloadCD ()
void repaintCD ()
void callCDAction (String action)
void callCDItem (String action, boolean flag)
void callCDToggleItem (String action)
void mouseWheelMoved (MouseWheelEvent e)

Public Attributes

Image I = null
int IW = 0
double Xmin
boolean Visual = Global.getParameter("options.visual",true)
int GridColor = 0
boolean ShowGrid = false
boolean GridLabels = true
Dimension UseSize = null
boolean SmartBoardPreview = false
double SelectionPointFactor = Global.getParameter("selectionsize",1.5)
double Scale = 1.0
boolean ProtectMacros = false
MacroMenu MM = null
String MacroCurrentComment
ConstructionDisplayPanel CDP = null

Static Public Attributes

static double EditFactor = 1000000.0

Package Functions

void dopaint (MyGraphics IG)
void dopaintFig (MyGraphicsFig IG)
void paintGrid (MyGraphics IG)
 Paint axes and grid.
void paintAxes (MyGraphics IG)
 Paint only the coordinate axes (no grid)
boolean rekformat (double h, int k)
boolean defineMacro ()
 Define a macro.

Package Attributes

ObjectConstructor OC = new MoverTool()
Construction C = new Construction()
Construction COriginal
StatusListener SL = null
MyGraphics IG
Image Background = null
FontMetrics FM
double PointSize = 4.0
double MinPointSize = 3.0
double FontSize = 12.0
double MinFontSize = 12.0
int IH = 0
double DX
double Ymin
double DY
boolean ShowHidden = false
Frame F = new Frame()
boolean ReadOnly
boolean AllowRightMouse = true
PopupMenu PM
CheckboxMenuItem CheckboxHidden
MenuItem Replay
MenuItem Empty
boolean Job = false
String Last = ""
Vector Targets = new Vector()
ConstructionObject TargetO []
ConstructionObject TargetS []
int ShowColor = 0
boolean All
boolean Interactive = true
int GridThickness = ConstructionObject.THIN
boolean AxesOnly = false
boolean GridBold = false
boolean GridLarge = false
ZirkelCanvasInterface ZCI
DoneListener DL
int Moved = 0
boolean Dragging = false
boolean RightClicked = false
boolean Control = false
DragThread DT = null
ConstructionObject LastPaint = null
boolean Frozen = false
MessageWindow MW
final double PointSizeFactor = 240.0
int CC = 0
MyVector Breaks = new MyVector()
int xg [] = new int[64]
int yg [] = new int[64]
int nc
MyVector V = new MyVector()
boolean NewPoint = false
boolean IntersectionYes = false
MyVector Indicated = new MyVector()
PointObject IndicatePoint = null
boolean Preview = false
ConstructionObject LastNonPreview = null
MoveableObject PreviewObject = null
Vector Macros = new Vector()
MacroBar MBar
TextField TF
Image OldBackground = null
MyVector Drawings = new MyVector()
int PointLast
int LineLast
int AngleLast
sHotEqn HE = null

Static Package Attributes

static double LengthsFactor = 100.0
static double AnglesFactor = 1.0
static char c [] = new char[20]

Detailed Description

Author:
Rene Main class, doing most of the work in the C.a.R. application. This canvas handles mouse and keyboard input, displays the construction and has tools to save and load constructions.

Definition at line 36 of file ZirkelCanvas.java.


Constructor & Destructor Documentation

rene.zirkel.ZirkelCanvas.ZirkelCanvas ( boolean  readonly,
boolean  replay,
boolean  hidden 
) [inline]

Initiate an empty construction.

The display may have a popup menu (only for readonly displays).

Parameters:
readonlyUser cannot change the construction.
replayReplay option in popup menu.
hiddenShow hidden option in popup menu.

Definition at line 88 of file ZirkelCanvas.java.

       {      ReadOnly=readonly;
              AllowRightMouse=!readonly;
              if (Global.getParameter("options.nopopupmenu",false))
              {      PM=null;
              }
              else if (ReadOnly)
              {      PM=new PopupMenu();
                     CheckboxHidden=new MyCheckboxMenuItem(
                            Zirkel.name("popup.hidden"));
                     CheckboxHidden.addItemListener(this);
                     if (hidden) PM.add(CheckboxHidden);
                     Replay=new MyMenuItem(
                            Zirkel.name("popup.replay"));
                     Replay.addActionListener(this);
                     if (replay) PM.add(Replay);
                     if (hidden || replay) add(PM);
                     else PM=null;
              }
              else
              {      PM=new PopupMenu();
                     Empty=new MyMenuItem(
                            Zirkel.name("popup.empty"));
                     add(PM);
              }
              C.CL=this;
              clear();
              updateDigits();
              C.addAddEventListener(this);
              addMouseWheelListener(this);
       }

Here is the call graph for this function:

Definition at line 119 of file ZirkelCanvas.java.

       {      this(readonly,true,true);
       }

Definition at line 122 of file ZirkelCanvas.java.

       {      this(false,true,true);
       }

Member Function Documentation

void rene.zirkel.ZirkelCanvas.actionPerformed ( ActionEvent  e) [inline]

Definition at line 180 of file ZirkelCanvas.java.

       {      if (!Interactive) return;
              if (e.getSource()==Replay)
              {      if (ZCI!=null) ZCI.replayChosen();
              }
              else
              {      Enumeration en=Macros.elements();
                     while (en.hasMoreElements())
                     {      MacroItem m=(MacroItem)en.nextElement();
                            if (m.I==e.getSource())
                            {      if (ZCI!=null) ZCI.runMacro(m.M);
                                   break;
                            }
                     }
              }
       }

Here is the call graph for this function:

synchronized void rene.zirkel.ZirkelCanvas.addDrawing ( Drawing  d) [inline]

Definition at line 3903 of file ZirkelCanvas.java.

       {      Drawings.addElement(d);
       }

Here is the caller graph for this function:

void rene.zirkel.ZirkelCanvas.added ( Construction  c,
ConstructionObject  o 
) [inline]

A construction added an item.

Check, if it solves a problem and notify the DoneListener, if so.

Definition at line 286 of file ZirkelCanvas.java.

       {      if (displayJob() && TargetO.length>0)
              {      boolean olddone=true;
                     for (int i=0; i<TargetO.length; i++)
                     {      if (TargetS[i]!=null && !TargetS[i].isInConstruction())
                                   TargetS[i]=null;
                            if (TargetS[i]!=null) continue;
                            else olddone=false;
                            if (TargetO[i].equals(o))
                            {      TargetS[i]=o;
                            }
                     }
                     boolean done=true;
                     for (int i=0; i<TargetO.length; i++)
                     {      if (TargetS[i]==null)
                            {      done=false; break;
                            }
                     }
                     if (done && DL!=null && !olddone)
                     {      repaint();
                            DL.notifyDone();
                            freeJob();
                     }
              }
              repaint();
       }

Here is the call graph for this function:

void rene.zirkel.ZirkelCanvas.addJobTarget ( ConstructionObject  target,
boolean  visible 
) [inline]

Definition at line 2744 of file ZirkelCanvas.java.

       {      if (visible) Targets.addElement("~"+target.getName());
              else Targets.addElement(target.getName());
       }

Here is the caller graph for this function:

void rene.zirkel.ZirkelCanvas.addObject ( ConstructionObject  o) [inline]

Add an item to the construction and re-paint the construction.

Definition at line 272 of file ZirkelCanvas.java.

       {      C.add(o);
              if (Preview)
              {      o.setIndicated(true);
                     o.setSelectable(false);
              }
              C.updateCircleDep();
       }

Here is the caller graph for this function:

void rene.zirkel.ZirkelCanvas.addStatusListener ( StatusListener  sl) [inline]

Definition at line 2270 of file ZirkelCanvas.java.

       {      SL=sl;
       }

Here is the caller graph for this function:

Definition at line 3857 of file ZirkelCanvas.java.

       {      AllowRightMouse=flag;
       }

Here is the caller graph for this function:

void rene.zirkel.ZirkelCanvas.appendMacro ( Macro  m) [inline]

Definition at line 3189 of file ZirkelCanvas.java.

       {      if (!ReadOnly)
              {      if (ProtectMacros) m.setProtected(true);
                     if (MM==null) MM=new MacroMenu(PM,"",null);
                     MacroItem mi=MM.add(m,m.getName());
                     mi.I.addActionListener(this);
                     Macros.addElement(mi);
              }
              else
              {      if (MM==null) MM=new MacroMenu(null,"",null);
                     MacroItem mi=MM.add(m,m.getName());
                     if (mi.I!=null) mi.I.addActionListener(this);
                     Macros.addElement(mi);
              }
       }

Here is the caller graph for this function:

synchronized void rene.zirkel.ZirkelCanvas.back ( ) [inline]

Delete last construction step done by user (highest number) and all non-visible steps before it.

Definition at line 2217 of file ZirkelCanvas.java.

       {      reset();
              ConstructionObject O=C.lastByNumber();
              if (O==null) return;
              if (O.isKeep()) return;
              delete(O);
              while (true)
              {      O=C.lastByNumber();
                     if (O==null) break;
                     else if (!O.mustHide(this) || O.isHideBreak() || O.isKeep()) break;
                     delete(O);
              }
              validate();
       }

Here is the call graph for this function:

Here is the caller graph for this function:

void rene.zirkel.ZirkelCanvas.bind ( PointObject  p) [inline]

Definition at line 3820 of file ZirkelCanvas.java.

       {      setTool(new BinderTool(this,p,OC));
       }

Here is the call graph for this function:

Here is the caller graph for this function:

void rene.zirkel.ZirkelCanvas.breakpointLast ( boolean  flag,
boolean  hiding 
) [inline]

Definition at line 4137 of file ZirkelCanvas.java.

       {      ConstructionObject o=C.last();
              if (o==null) return;
              if (hiding) o.setHideBreak(flag);
              else o.setBreak(flag);
       }

Here is the caller graph for this function:

void rene.zirkel.ZirkelCanvas.callCDAction ( String  action) [inline]

Definition at line 4201 of file ZirkelCanvas.java.

       {      if (CDP!=null && C!=null) CDP.doAction(action);
       }

Here is the caller graph for this function:

void rene.zirkel.ZirkelCanvas.callCDItem ( String  action,
boolean  flag 
) [inline]

Definition at line 4205 of file ZirkelCanvas.java.

       {      if (CDP!=null && C!=null) CDP.itemAction(action,flag);
       }

Here is the caller graph for this function:

void rene.zirkel.ZirkelCanvas.callCDToggleItem ( String  action) [inline]

Definition at line 4209 of file ZirkelCanvas.java.

       {      if (CDP!=null && C!=null) CDP.itemToggleAction(action);
       }

Here is the caller graph for this function:

boolean rene.zirkel.ZirkelCanvas.canConvert ( Construction  c,
TwoPointLineObject  o 
) [inline]

See, if this two point line can be converted to a primitive line.

Definition at line 3148 of file ZirkelCanvas.java.

       {      PointObject p1=o.getP1(),p2=o.getP2();
              if (p1.isMainParameter() || p2.isMainParameter()) return false;
              return !(needed(c,p1,o) || needed(c,p2,o));
       }

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 3861 of file ZirkelCanvas.java.

       {      return C.changed();
       }

Here is the caller graph for this function:

boolean rene.zirkel.ZirkelCanvas.check ( Construction  c) [inline]

Definition at line 313 of file ZirkelCanvas.java.

       {      int n=TargetO.length;
              for (int i=0; i<n; i++)
              {      TargetS[i]=null;
              }
              int found=0;
              Enumeration e=c.elements();
              while (e.hasMoreElements())
              {      ConstructionObject o=(ConstructionObject)e.nextElement();
                     if (o.isKeep()) continue;
                     for (int i=0; i<n; i++)
                     {      if (TargetS[i]!=null) continue;
                            if (o.equals(TargetO[i]))
                            {      TargetS[i]=o;
                                   found++; break;
                            }
                     }
              }
              return found==n;
       }

Here is the caller graph for this function:

void rene.zirkel.ZirkelCanvas.check ( ) [inline]

Check if the solution to the current problem has been found.

Definition at line 337 of file ZirkelCanvas.java.

       {      if (displayJob() && TargetO.length>0)
              {      boolean olddone=true;
                     for (int i=0; i<TargetO.length; i++)
                     {      if (TargetS[i]!=null && !TargetS[i].isInConstruction())
                                   TargetS[i]=null;
                            if (TargetS[i]!=null) continue;
                            else olddone=false;
                     }
                     boolean done=check(C);
                     if (done && DL!=null && !olddone)
                     {      repaint();
                            DL.notifyDone();
                            freeJob();
                     }
              }
       }

Here is the call graph for this function:

Here is the caller graph for this function:

The user has to choose from a list of macros (for running).

Definition at line 3232 of file ZirkelCanvas.java.

       {      if (Macros.size()==0)
              {      warning(Zirkel.name("definemacro.nomacro"));
                     return null;
              }
              MacroSelectDialog d=new MacroSelectDialog(getFrame(),MM,false);
              d.setVisible(true);
              return d.getMacro();
       }

Here is the call graph for this function:

Here is the caller graph for this function:

Macro rene.zirkel.ZirkelCanvas.chooseMacro ( String  name) [inline]

Run a macro by name.

Definition at line 3260 of file ZirkelCanvas.java.

       {      Enumeration e=Macros.elements();
              while (e.hasMoreElements())
              {      Macro m=((MacroItem)e.nextElement()).M;
                     if (m.getName().equals(name))
                            return m;
              }
              return null;
       }

The user can choose from a list of macros (for saving).

Returns:
A vector of selected Macros.

Definition at line 3246 of file ZirkelCanvas.java.

       {      if (Macros.size()==0)
              {      warning(Zirkel.name("definemacro.nomacro"));
                     return null;
              }
              MacroSelectDialog d=
                     new MacroSelectDialog(getFrame(),MM,true);
              d.setVisible(true);
              return d.getMacros();
       }

Here is the call graph for this function:

Here is the caller graph for this function:

synchronized void rene.zirkel.ZirkelCanvas.clear ( ) [inline]

Definition at line 2201 of file ZirkelCanvas.java.

       {      displayJob(false);
              if (OC!=null) OC.invalidate(this);
              C.clear(); recompute();
              setDefaultColor(0);
              setDefaultColorType(0);
              setDefaultType(2);
              setGrid();
              reloadCD();
       }

Here is the call graph for this function:

Here is the caller graph for this function:

synchronized void rene.zirkel.ZirkelCanvas.clearDrawings ( ) [inline]

Definition at line 3907 of file ZirkelCanvas.java.

       {      Drawings.removeAllElements();
              repaint();
       }      

Here is the caller graph for this function:

Definition at line 1921 of file ZirkelCanvas.java.

       {      IndicatePoint=null;
              if (Indicated.size()==0) return;
              Enumeration e=Indicated.elements();
              while (e.hasMoreElements())
                     ((ConstructionObject)e.nextElement()).setIndicated(false);
              Indicated.removeAllElements();
              setCursor(Cursor.getDefaultCursor());
              repaint();
       }

Here is the caller graph for this function:

Cancel the job state o fthe current construction.

Definition at line 2754 of file ZirkelCanvas.java.

       {      Job=false;
       }

Here is the caller graph for this function:

Definition at line 3286 of file ZirkelCanvas.java.

       {      Enumeration e=Macros.elements();
              while (e.hasMoreElements())
              {      MacroItem m=(MacroItem)e.nextElement();
                     if (m.I!=null)
                     {      m.I.removeActionListener(this);
                            MM.remove(m);
                     }
              }
              Macros.removeAllElements();
       }

Here is the caller graph for this function:

Definition at line 3298 of file ZirkelCanvas.java.

       {      Vector V=new Vector();      
              Enumeration e=Macros.elements();
              while (e.hasMoreElements())
              {      MacroItem m=(MacroItem)e.nextElement();
                     if (!m.M.isProtected()) V.addElement(m);
              }
              deleteMacros(V);
       }

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1953 of file ZirkelCanvas.java.

       {      if (!Preview) return;
              C.clearAfter(LastNonPreview);
              LastNonPreview=null;
              PreviewObject=null;
              Preview=false;
              Count.fixAll(false);
       }

Here is the caller graph for this function:

Definition at line 3308 of file ZirkelCanvas.java.

       {      Vector V=new Vector();      
              Enumeration e=Macros.elements();
              while (e.hasMoreElements())
              {      MacroItem m=(MacroItem)e.nextElement();
                     if (m.M.isProtected()) V.addElement(m);
              }
              deleteMacros(V);
       }

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 2191 of file ZirkelCanvas.java.

       {      Enumeration e=C.elements();
              while (e.hasMoreElements())
              {      ConstructionObject o=(ConstructionObject)e.nextElement();
                     o.setSelected(false);
              }
              repaint();
       }

Here is the caller graph for this function:

Definition at line 2748 of file ZirkelCanvas.java.

       {      Targets=new Vector();
       }

Here is the caller graph for this function:

double rene.zirkel.ZirkelCanvas.col ( double  x) [inline]

Definition at line 199 of file ZirkelCanvas.java.

       {      return (x-Xmin)/DX*IW;
       }
Macro rene.zirkel.ZirkelCanvas.copyMacro ( Macro  m,
String  name,
boolean  fixed[] 
) [inline]

Copy a macro with fixed parameters from another macro.

Definition at line 2960 of file ZirkelCanvas.java.

       {      try
              {      Macro macro=(Macro)(m.clone());
                     macro.Name=name;
                     boolean f[]=new boolean[fixed.length];
                     for (int i=0; i<f.length; i++) f[i]=fixed[i];
                     macro.Fixed=f;
                     storeMacro(macro,true);
                     return macro;
              }
              catch (Exception e) { return m; }
       }

Here is the call graph for this function:

Here is the caller graph for this function:

LatexOutput rene.zirkel.ZirkelCanvas.createBB ( String  filename,
int  w,
int  h,
double  dpi 
) [inline]

Definition at line 3503 of file ZirkelCanvas.java.

       {      try
              {      String path="";
                     if (Global.getParameter("options.fullpath",true))
                            path=FileName.pathAndSeparator(filename);
                     PrintWriter out=
                            new PrintWriter(new FileOutputStream(
                                          path+FileName.purefilename(filename)+".bb"));
                     out.println("%%BoundingBox: 0 0 "+w+" "+h);
                     out.close();
                     out=new PrintWriter(new FileOutputStream(
                                   path+FileName.purefilename(filename)+".ztx"));
                     LatexOutput lout=new LatexOutput(out);
                     lout.open(w,h,dpi,path+FileName.filename(filename));
                     return lout;
              }
              catch (Exception e)
              {      warning(e.toString());
              }
              return null;
       }

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 4108 of file ZirkelCanvas.java.

       {      FunctionObject f=new FunctionObject(C);
              f.setDefaults();
              C.add(f);
              f.setExpressions("x","x","0");
              f.edit(this);
              if (f.EditAborted) delete(f);
              repaint();
              reloadCD();
       }

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 4119 of file ZirkelCanvas.java.

       {      UserFunctionObject f=new UserFunctionObject(C);
              f.setDefaults();
              f.setShowName(true);
              f.setShowValue(true);
              C.add(f);
              f.setExpressions("x","0");
              f.edit(this);
              if (f.EditAborted) delete(f);
              repaint();
              reloadCD();
       }

Here is the call graph for this function:

Here is the caller graph for this function:

double rene.zirkel.ZirkelCanvas.dCenter ( double  x,
double  y 
) [inline]

Definition at line 244 of file ZirkelCanvas.java.

       {      double dx=x-(Xmin+DX/2),dy=y-(Ymin+DY/2);
              return Math.sqrt(dx*dx+dy*dy)/
                     Math.max(DX/2,DY/2);
       }

Here is the call graph for this function:

Here is the caller graph for this function:

Define a macro.

There must be parameters (but not necessarily targets). The function will display the macro dialog. It will create a new macro, when the dialog was not aborted. The macro is kept in the Macros vector by name.

Definition at line 2921 of file ZirkelCanvas.java.

       {      clearSelected();
              // Read the list of Parameters and Targets from the
              // construction. This list is filled by the SetParameter and
              // SetTargets constructors.
              Vector P=C.getParameters();
              if (P.size()==0) // no parameters
              {      warning(Zirkel.name("definemacro.noparams"));
                     return false;
              }
              // Display the macro creation dialog to the user.
              DefineMacro d=new DefineMacro(F,this);
              d.center(getFrame());
              d.setVisible(true);
              // Aborted?
              if (d.isAborted() || d.getName().equals("")) return false;
              // Define a marco with the name, the comment and the paramters.
              Macro m=new Macro(this,d.getName(),d.getComment(),d.getParams());
              // If there are no targets, determine everything as
              // constructed by the paramaters, else only the things needed
              // to get the targets.
              try
              {      defineMacro(C,m,d.targetsOnly(),d.invisible(),d.getPromptFor(),
                            d.hideduplicates());
              }
              catch (ConstructionException e)
              {      warning(e.getDescription());
                     OC.reset(this);
                     return false;
              }
              storeMacro(m,false);
              OC.reset(this);
              return true;
       }

Here is the call graph for this function:

Here is the caller graph for this function:

void rene.zirkel.ZirkelCanvas.defineMacro ( Construction  c,
Macro  m,
boolean  targetsonly,
boolean  superhide,
String  prompt[],
boolean  hideduplicates 
) throws ConstructionException [inline]

Define a macro based on a construction in c and the targets and parameters in this construction.

Store the macro in m.

Parameters:

Definition at line 2978 of file ZirkelCanvas.java.

       {      Vector P=c.getParameters(),T=c.getTargets();
              c.setTranslation(m); // for construction expressions only (windoww etc.)
              c.clearTranslations();
              if (T.size()==0) // got no targets 
                     c.determineConstructables();
              else // got targets
              {      c.clearConstructables();
                     c.setParameterAsConstructables();
                     for (int i=0; i<T.size(); i++)
                     {      c.determineConstructables((ConstructionObject)T.elementAt(i));
                     }
              }
              // Make sure the counter for the macro object names starts
              // fresh (P1, P2, ...)
              Count.setAllAlternate(true);
              // Walk through the construction and copy all marked objects
              // to the macro definition.
              m.clearTranslators();
              Enumeration e=c.elements();
              while (e.hasMoreElements())
              {      ConstructionObject o=(ConstructionObject)e.nextElement();
                     if (o instanceof TwoPointLineObject && 
                            canConvert(c,(TwoPointLineObject)o) && o.isMainParameter())
                     {      ((TwoPointLineObject)o).getP1().setFlag(false);
                            ((TwoPointLineObject)o).getP2().setFlag(false);
                     }                                  
              }
              e=c.elements();
              while (e.hasMoreElements())
              {      ConstructionObject oc,o=(ConstructionObject)e.nextElement();
                     if (o.isFlag() &&
                            !(o.isParameter() && !o.isMainParameter() && !needed(c,o,null)))
                     {      // System.out.println(o.getName()+", parameter: "+o.isParameter()+
                            //     ", main: "+o.isMainParameter()+", needed "+needed(c,o,null));
                            // Now copy to the macro, but make sure that parameters
                            // are simplified to their object type. E.g., an
                            // objectpoint becomes a point, if it is a parameter.
                            if (o instanceof PointObject && o.isParameter())
                            {      PointObject p=(PointObject)o;
                                   if (p.isSpecialParameter() && p.dependsOnParametersOnly())
                                          oc=(ConstructionObject)p.copy();
                                   else
                                          oc=new PointObject(c,p.getX(),p.getY());
                            }
                            else if (o instanceof FunctionObject && o.isParameter())
                            {      FunctionObject fo=new FunctionObject(c);
                                   fo.setExpressions("x","0","0");
                                   fo.setRange("-10","10","0.1");
                                   oc=fo;
                            }
                            else if (o instanceof UserFunctionObject && o.isParameter())
                            {      UserFunctionObject fo=new UserFunctionObject(c);
                                   fo.setExpressions("x","0");
                                   oc=fo;
                            }
                            else if (o instanceof ExpressionObject && o.isParameter())
                            {      oc=new ExpressionObject(c,0,0);
                                   ((ExpressionObject)oc).setExpression(o.getValue()+"",
                                                 o.getConstruction());
                                   ((ExpressionObject)oc).setCurrentValue(o.getValue());
                            }
                            else if (o instanceof TwoPointLineObject && 
                                   canConvert(c,(TwoPointLineObject)o) && o.isParameter())
                            {      oc=new PrimitiveLineObject(c);
                            }                                  
                            else if (o instanceof PrimitiveLineObject && 
                                   !(o instanceof TwoPointLineObject) &&
                                   !(o instanceof FixedAngleObject) &&
                                   o.isParameter())
                            {      oc=new PrimitiveLineObject(c);
                            }
                            else if (o instanceof PrimitiveCircleObject && o.isParameter())
                            {      oc=new PrimitiveCircleObject(c,
                                          ((PrimitiveCircleObject)o).getP1());
                                   oc.translateConditionals();
                                   oc.translate();
                            }
                            else if (o instanceof AreaObject && o.isParameter())
                            {      oc=new AreaObject(c,new Vector());
                                   oc.translateConditionals();
                                   oc.translate();
                            }
                            else
                            {      oc=(ConstructionObject)o.copy();
                            }
                            if (oc!=null)
                            {      m.add(oc);
                                   if (o.isMainParameter()) oc.setName(o.getName());
                                   if (targetsonly && !o.isTarget() && !o.isParameter())
                                   {      if (superhide) oc.setSuperHidden(true);
                                          else oc.setHidden(true);
                                   }
                                   if (o.isParameter() && o.isHidden())
                                   {      oc.setHidden(true);
                                   }
                                   // All parameters in the constructions translate to
                                   // the paramters in the macro definition.
                                   o.setTranslation(oc);
                            }
                     }
                     else o.setTranslation(null);
              }
              e=c.elements();
              while (e.hasMoreElements())
              {      ConstructionObject o=(ConstructionObject)e.nextElement();
                     if (o.isFlag() && !o.isParameter())
                            o.laterTranslate(c);
              }
              Count.setAllAlternate(false);
              // translate the @... forward declarations in FindObjectExpression.
              c.clearErrors();
              m.runTranslators(c);
              // see if any errors occured (@.. to nonexisting object, generated
              // by the FindObjectExpression on translation.
              e=c.getErrors();
              if (e.hasMoreElements())
              {      warning((String)e.nextElement(),"macroerror");
              }
              // Now set the paramter array and make sure it is translated
              // to the objects in the macro definition.
              ConstructionObject Params[]=new ConstructionObject[P.size()];
              for (int i=0; i<P.size(); i++)
              {      Params[i]=((ConstructionObject)P.elementAt(i)).getTranslation();
              }
              m.setParams(Params);
              String p[]=new String[prompt.length];
              for (int j=0; j<prompt.length; j++)
              {      ConstructionObject o=c.find(prompt[j]);
                     if (o==null || o.getTranslation()==null ||
                            !(o instanceof FixedCircleObject || 
                                   o instanceof FixedAngleObject ||
                                   o instanceof ExpressionObject))
                            throw new ConstructionException(
                                   Zirkel.name("exception.prompt"));
                     for (int i=0; i<P.size(); i++)
                     {      ConstructionObject op=(ConstructionObject)P.elementAt(i);
                            if (op==o)
                                   throw new ConstructionException(
                                          Zirkel.name("exception.prompt.parameter"));
                     }
                     p[j]=o.getTranslation().getName();
              }
              m.setPromptFor(p);
              for (int i=0; i<prompt.length; i++)
                     m.setPromptName(i,prompt[i]);
              m.hideDuplicates(hideduplicates);
       }

Here is the call graph for this function:

void rene.zirkel.ZirkelCanvas.defineMacro ( String  name,
String  comment,
Construction  c 
) throws ConstructionException [inline]

Define a macro from the information stored in the construction c, and store it to the macros in this ZirkelCanvas object.

Definition at line 3158 of file ZirkelCanvas.java.

       {      Vector T=c.getTargets();
              String Prompts[]=new String[c.Prompts.size()];
              for (int i=0; i<Prompts.length; i++)
                     Prompts[i]=(String)c.Prompts.elementAt(i);
              Macro m=new Macro(this,name,comment,Prompts);
              defineMacro(c,m,T.size()>0 && !c.ShowAll,c.SuperHide,c.getPromptFor(),true);
              storeMacro(m,true);
       }

Here is the call graph for this function:

void rene.zirkel.ZirkelCanvas.delete ( ConstructionObject  o) [inline]

Definition at line 2237 of file ZirkelCanvas.java.

       {      if (C.last()==null) return;
              if (o.isKeep()) return;
              C.clearConstructables();
              o.setFlag(true);
              C.determineChildren();
              C.delete(false);
       }

Here is the caller graph for this function:

void rene.zirkel.ZirkelCanvas.delete ( Vector  v) [inline]

Delete a vector of construction objects.

Parameters:
v

Definition at line 2250 of file ZirkelCanvas.java.

       {      if (C.last()==null) return;
              C.clearConstructables();
              Enumeration e=v.elements();
              while (e.hasMoreElements())
              {      ConstructionObject o=(ConstructionObject)e.nextElement();
                     if (o.isKeep()) return;
                     o.setFlag(true);
              }
              C.determineChildren();
              C.delete(false);
       }
void rene.zirkel.ZirkelCanvas.deleteMacro ( MacroItem  m) [inline]

Definition at line 3278 of file ZirkelCanvas.java.

       {      Macros.removeElement(m);
              if (m.I!=null)
              {      m.I.removeActionListener(this);
                     MM.remove(m);
              }
       }

Here is the caller graph for this function:

void rene.zirkel.ZirkelCanvas.deleteMacros ( Vector  v) [inline]

Definition at line 3270 of file ZirkelCanvas.java.

       {      Enumeration e=v.elements();
              while (e.hasMoreElements())
              {      MacroItem m=(MacroItem)e.nextElement();
                     deleteMacro(m);
              }
       }

Here is the call graph for this function:

Here is the caller graph for this function:

boolean rene.zirkel.ZirkelCanvas.depends ( ConstructionObject  o,
ConstructionObject  on 
) [inline]

Definition at line 2263 of file ZirkelCanvas.java.

       {      C.clearConstructables();
              on.setFlag(true);
              C.determineChildren();
              return o.isFlag();
       }

Here is the caller graph for this function:

This will display the construction as a job (if it is a job).

The construction is copied up to the last element. The copies are marked as keep objects, so that they cannot be changed. The last object is marked as the target object, so that it displays in a special color.

The function can also flip back to the original construction (flag=false).

Definition at line 2789 of file ZirkelCanvas.java.

       {      clearSelected();
              if (!(OC instanceof SaveJob)) OC.reset(this);
              if (flag) // diplay the job
              {      C.setOriginalOrder(true);
                     if (displayJob() || !isJob()) return;
                     Construction Cnew=new Construction();
                     Cnew.setXYW(C.getX(),C.getY(),C.getW());
                     Enumeration e=C.elements();
                     while (e.hasMoreElements())
                     {      ConstructionObject o=(ConstructionObject)e.nextElement();
                            o.setJobTarget(true);
                            o.setJobTarget(false);
                     }
                     e=C.elements();
                     while (e.hasMoreElements())
                     {      ConstructionObject o=(ConstructionObject)e.nextElement();
                            Cnew.add(o); o.setKeep(true);
                            if (inTargets(o.getName()) || inTargets("~"+o.getName())) 
                                   o.setJobTarget(true);
                            if (o.getName().equals(Last)) break;
                     }
                     while (e.hasMoreElements())
                     {      ConstructionObject o=(ConstructionObject)e.nextElement();
                            if (inTargets(o.getName()) || inTargets("~"+o.getName()))
                            {      Cnew.add(o); o.setKeep(true);
                                   o.setJobTarget(true);
                            }
                     }
                     int n=0;
                     e=Targets.elements();
                     while (e.hasMoreElements())
                     {      String s=(String)e.nextElement();
                            if (!s.startsWith("~")) n++;
                     }
                     TargetO=new ConstructionObject[n];
                     TargetS=new ConstructionObject[n];
                     n=0;
                     e=Targets.elements();
                     while (e.hasMoreElements())
                     {      String s=(String)e.nextElement();
                            if (!s.startsWith("~"))
                            {      TargetO[n]=Cnew.find(s);
                                   TargetS[n]=null;
                                   n++;
                            }
                     }
                     COriginal=C;
                     C=Cnew;
                     C.addAddEventListener(this);
                     C.setComment(COriginal.getJobComment());
                     recompute();
                     reloadCD();
                     repaint();
              }
              else // display the orginal construction again
              {      if (!displayJob()) return;
                     C.removeAddEventListener(this);
                     C=COriginal;
                     COriginal=null;
                     Enumeration e=C.elements();
                     while (e.hasMoreElements())
                     {      ConstructionObject o=
                                   (ConstructionObject)e.nextElement();
                            o.setKeep(false);
                            o.setJobTarget(false);
                     }
                     C.setOriginalOrder(false);
                     recompute();
                     reloadCD();
                     repaint();
              }
       }

Here is the call graph for this function:

Here is the caller graph for this function:

Test if the canvas displays a job right now.

Definition at line 2879 of file ZirkelCanvas.java.

       {      return COriginal!=null;
       }

Here is the caller graph for this function:

Image rene.zirkel.ZirkelCanvas.doLoadImage ( String  filename) [inline]

Definition at line 176 of file ZirkelCanvas.java.

       {      return ZCI.doLoadImage(filename);
       }

Here is the call graph for this function:

Here is the caller graph for this function:

synchronized void rene.zirkel.ZirkelCanvas.doMouseDragged ( MouseEvent  e) [inline]

Definition at line 534 of file ZirkelCanvas.java.

       {      OC.mouseDragged(e,this);
       }

Here is the caller graph for this function:

void rene.zirkel.ZirkelCanvas.dopaint ( MyGraphics  IG) [inline, package]

Definition at line 673 of file ZirkelCanvas.java.

       {      
              if (ShowGrid) 
              {      if (AxesOnly) paintAxes(IG);
                     else paintGrid(IG);
              }
              long time=System.currentTimeMillis();
              updateBreakHide();
              // count z-buffer elements and mark all as non-painted
              Enumeration e=C.elements();
              int n=0;
              while (e.hasMoreElements())
              {      ConstructionObject o=(ConstructionObject)e.nextElement();
                     o.HasZ=false;
                     o.IsDrawn=false;
                     try
                     {      if (!o.selected())
                            {      o.Value=-o.getZ(); o.HasZ=true; n++;
                            }
                     }
                     catch (Exception ex) {}
                     if (o==LastPaint) break;
              }
              // paint background objects
              e=C.elements();
              while (e.hasMoreElements())
              {      ConstructionObject o=(ConstructionObject)e.nextElement();
                     if (o.isBack() && !o.HasZ)
                     {      o.paint(IG,this); o.IsDrawn=true;
                     }
                     if (o==LastPaint) break;
              }
              // paint objects with z-buffer value in their order
              if (n>0)
              {      ConstructionObject os[]=new ConstructionObject[n];
                     e=C.elements();
                     n=0;
                     while (e.hasMoreElements())
                     {      ConstructionObject o=(ConstructionObject)e.nextElement();
                            if (o.HasZ) os[n++]=o;
                     }
                     Sorter.sort(os);
                     for (int i=0; i<n; i++)
                     {      os[i].paint(IG,this);
                            os[i].IsDrawn=true;
                     }
              }
              // paint non-selected objects
              e=C.elements();
              while (e.hasMoreElements())
              {      ConstructionObject o=(ConstructionObject)e.nextElement();
                     if (!o.selected() && !o.IsDrawn)
                     {      o.paint(IG,this);
                            o.IsDrawn=true;
                     }
                     if (o==LastPaint) break;
              }
              // paint selected objects
              e=C.elements();
              while (e.hasMoreElements())
              {      ConstructionObject o=(ConstructionObject)e.nextElement();
                     if (!o.IsDrawn) 
                     {      o.paint(IG,this);
                            o.IsDrawn=true;
                     }
                     if (o==LastPaint) break;
              }
              if (LastPaint==null) paintTrack(IG);
              if (Interactive && IndicatePoint!=null) IndicatePoint.paint(IG,this);
              time=System.currentTimeMillis()-time;
              if (time>250 && PolygonDrawer.step<50) 
                     PolygonDrawer.step=PolygonDrawer.step*2;
              if (time<100 && PolygonDrawer.step>4) 
                     PolygonDrawer.step=PolygonDrawer.step/2;
              paintDrawings(IG);
       }

Here is the call graph for this function:

Here is the caller graph for this function:

void rene.zirkel.ZirkelCanvas.dopaintFig ( MyGraphicsFig  IG) [inline, package]

Definition at line 750 of file ZirkelCanvas.java.

       {      if (ShowGrid) paintGrid(IG);
              IG.pushLayer(true);
              int layer=0;
              while (true)
              {      IG.pushLayer();
                     int l=0;
                     Enumeration e=C.elements();
                     while (e.hasMoreElements())
                     {      ConstructionObject o=(ConstructionObject)e.nextElement();
                            if (o==LastPaint) break;
                            if (l==layer && o.isBack()) o.paint(IG,this);
                            if (o.isBreak())
                            {      l++;
                                   if (l>layer) break;
                            }
                     }
                     if (l<layer) break;
                     l=0;
                     e=C.elements();
                     while (e.hasMoreElements())
                     {      ConstructionObject o=(ConstructionObject)e.nextElement();
                            if (o==LastPaint) break;
                            if (l==layer && !o.isBack() && !o.selected()) o.paint(IG,this);
                            if (o.isBreak())
                            {      l++;
                                   if (l>layer) break;
                            }
                     }
                     l=0;
                     e=C.elements();
                     while (e.hasMoreElements())
                     {      ConstructionObject o=(ConstructionObject)e.nextElement();
                            if (o==LastPaint) break;
                            if (l==layer && !o.isBack() && o.selected()) o.paint(IG,this);
                            if (o.isBreak())
                            {      l++;
                                   if (l>layer) break;
                            }
                     }
                     layer++;
              }
              IG.pushLayer(false);
              if (LastPaint==null) paintTrack(IG);
       }

Here is the call graph for this function:

Here is the caller graph for this function:

synchronized void rene.zirkel.ZirkelCanvas.dovalidate ( ) [inline]

Synchronized update of the construction to avoid a repaint during update.

Definition at line 1106 of file ZirkelCanvas.java.

       {      C.dovalidate();
       }

Here is the caller graph for this function:

double rene.zirkel.ZirkelCanvas.dx ( int  c) [inline]

Definition at line 217 of file ZirkelCanvas.java.

       {      return DX*c/IW;
       }

Here is the caller graph for this function:

double rene.zirkel.ZirkelCanvas.dx ( double  c) [inline]

Definition at line 223 of file ZirkelCanvas.java.

       {      return DX*c/IW;
       }
double rene.zirkel.ZirkelCanvas.dy ( int  r) [inline]

Definition at line 220 of file ZirkelCanvas.java.

       {      return DY*r/IH;
       }

Here is the caller graph for this function:

double rene.zirkel.ZirkelCanvas.dy ( double  r) [inline]

Definition at line 226 of file ZirkelCanvas.java.

       {      return DY*r/IH;
       }

Definition at line 4132 of file ZirkelCanvas.java.

       {      if (C.last()==null) return;
              C.last().edit(this);
       }

Here is the caller graph for this function:

boolean rene.zirkel.ZirkelCanvas.enabled ( String  function) [inline]

Definition at line 3844 of file ZirkelCanvas.java.

       {      if (ZCI!=null) return ZCI.enabled(function);
              else return true;
       }

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 4153 of file ZirkelCanvas.java.

       {      Interactive=true;
              hideMessage();
       }

Here is the call graph for this function:

Here is the caller graph for this function:

void rene.zirkel.ZirkelCanvas.filter ( MyVector  v,
int  x,
int  y,
boolean  choice 
) [inline]

try to determine the unique objects that are near coordinates x,y and delete all others from the vector v.

Definition at line 1792 of file ZirkelCanvas.java.

       {      boolean HasPoints=false,HasNotFilled=false;
              Enumeration e=v.elements();
              while (e.hasMoreElements())
              {      ConstructionObject o=(ConstructionObject)e.nextElement();
                     if (o instanceof PointObject)
                     {      HasPoints=true;
                     }
                     if (!o.isFilledForSelect())
                     {      HasNotFilled=true;
                     }
              }
              if (HasPoints)
              {      e=v.elements();
                     while (e.hasMoreElements())
                     {      ConstructionObject o=(ConstructionObject)e.nextElement();
                            if (!o.onlynearto(x,y,this)) v.removeElement(o);
                     }
              }
              else if (HasNotFilled)
              {      e=v.elements();
                     while (e.hasMoreElements())
                     {      ConstructionObject o=(ConstructionObject)e.nextElement();
                            if (o.isFilledForSelect()) v.removeElement(o);
                     }
              }
              sort(v);
              if (!choice)
              {      v.truncate(1);
              }
       }

Here is the call graph for this function:

Here is the caller graph for this function:

void rene.zirkel.ZirkelCanvas.filter ( MyVector  v,
int  x,
int  y 
) [inline]

Definition at line 1823 of file ZirkelCanvas.java.

       {      filter(v,x,y,Global.getParameter("options.choice",true) || Control);
       }

Here is the call graph for this function:

Here is the caller graph for this function:

ConstructionObject rene.zirkel.ZirkelCanvas.findSelectedObject ( ) [inline]

Definition at line 1880 of file ZirkelCanvas.java.

       {      Enumeration e=C.elements();
              while (e.hasMoreElements())
              {      ConstructionObject o=(ConstructionObject)e.nextElement();
                     if (o.selected()) return o;
              }
              return null;
       }

Here is the caller graph for this function:

String rene.zirkel.ZirkelCanvas.format ( double  x) [inline]

Definition at line 1038 of file ZirkelCanvas.java.

       {      // double xx=x;
              nc=0;
              boolean minus=false;
              if (x<-1e-12)
              {      minus=true; x=-x;
              }
              x+=1e-12;
              double h=x-Math.floor(x);
              if (rekformat(h,8)) c[nc++]='.';
              while (x>=1)
              {      double s=Math.floor(x/10);
                     c[nc++]=(char)('0'+(int)(x-s*10));
                     x=s;
              }
              if (nc>0 && minus) c[nc++]='-';
              // revert c:
              for (int i=0; i<nc/2; i++)
              {      char hc=c[nc-1-i];
                     c[nc-1-i]=c[i];
                     c[i]=hc;
              }
              // System.out.println(xx+" -> "+new String(c,0,nc));
              return new String(c,0,nc);
       }

Here is the call graph for this function:

Here is the caller graph for this function:

If the job is solved, this function removes all restrictions.

Definition at line 2866 of file ZirkelCanvas.java.

       {      Enumeration e=C.elements();
              while (e.hasMoreElements())
              {      ConstructionObject o=(ConstructionObject)e.nextElement();
                     o.setKeep(false);
                     o.setJobTarget(false);
                     repaint();
              }
       }

Here is the caller graph for this function:

Definition at line 2341 of file ZirkelCanvas.java.

       {      return C.BoldFont;
       }

Definition at line 2652 of file ZirkelCanvas.java.

       {      return C.getComment();
       }

Here is the caller graph for this function:

Construction rene.zirkel.ZirkelCanvas.getConstruction ( ) [inline]

Definition at line 2711 of file ZirkelCanvas.java.

       {      return C;
       }
ObjectConstructor rene.zirkel.ZirkelCanvas.getCurrentTool ( ) [inline]

Definition at line 3897 of file ZirkelCanvas.java.

       {      return OC;
       }

Here is the caller graph for this function:

Definition at line 2289 of file ZirkelCanvas.java.

       {      return C.DefaultColor;
       }

Here is the caller graph for this function:

Definition at line 2376 of file ZirkelCanvas.java.

       {      return C.DefaultColorType;
       }

Here is the caller graph for this function:

Definition at line 2296 of file ZirkelCanvas.java.

       {      return C.DefaultType;
       }

Here is the caller graph for this function:

Definition at line 2673 of file ZirkelCanvas.java.

       {      return F;
       }

Here is the caller graph for this function:

Definition at line 3454 of file ZirkelCanvas.java.

       {      double gridsize=Math.pow(10,Math.floor(
                     Math.log(C.getW()*2)/Math.log(10)))/10;
              if (C.getW()*2/gridsize>=30) gridsize*=5;
              if (C.getW()*2/gridsize<10) gridsize/=2;
              return gridsize;
       }

Here is the caller graph for this function:

Definition at line 2659 of file ZirkelCanvas.java.

       {      return C.getJobComment();
       }

Here is the caller graph for this function:

Definition at line 2334 of file ZirkelCanvas.java.

       {      return C.LargeFont;
       }

Definition at line 2327 of file ZirkelCanvas.java.

       {      return C.LongNames;
       }

Definition at line 2897 of file ZirkelCanvas.java.

       {      return Macros;
       }

Here is the caller graph for this function:

Definition at line 128 of file ZirkelCanvas.java.

       {      if (Background==null || !Global.getParameter("background.usesize",false))
              {      if (UseSize!=null) return UseSize;
                     else return new Dimension(600,600);
              }
              else
              {      int iw=Background.getWidth(this);
                     if (iw<10) return new Dimension(600,600);
                     int ih=Background.getHeight(this);
                     if (Global.getParameter("background.usewidth",false))
                     {      int w=getSize().width,h=(int)((double)ih/iw*w+0.5);
                            return new Dimension(w,h);
                     }
                     else
                            return new Dimension(iw,ih);
              }
       }

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 2348 of file ZirkelCanvas.java.

       {      return C.Obtuse;
       }
ObjectConstructor rene.zirkel.ZirkelCanvas.getOC ( ) [inline]

Definition at line 2891 of file ZirkelCanvas.java.

{ return OC; }       

Here is the caller graph for this function:

Definition at line 2302 of file ZirkelCanvas.java.

       {      return C.Partial;
       }

Here is the caller graph for this function:

Definition at line 2314 of file ZirkelCanvas.java.

       {      return C.PartialLines;
       }

Here is the caller graph for this function:

Definition at line 146 of file ZirkelCanvas.java.

       {      return getMinimumSize();
       }

Here is the call graph for this function:

Definition at line 2308 of file ZirkelCanvas.java.

       {      return C.Restricted;
       }

Here is the caller graph for this function:

Definition at line 2889 of file ZirkelCanvas.java.

{ return ShowColor; }

Here is the caller graph for this function:

Definition at line 2383 of file ZirkelCanvas.java.

       {      return ShowHidden;
       }

Definition at line 2362 of file ZirkelCanvas.java.

       {      return C.ShowNames;
       }

Definition at line 2369 of file ZirkelCanvas.java.

       {      return C.ShowValues;
       }

Definition at line 2355 of file ZirkelCanvas.java.

       {      return C.Solid;
       }

Definition at line 2320 of file ZirkelCanvas.java.

       {      return C.Vectors;
       }

Here is the caller graph for this function:

void rene.zirkel.ZirkelCanvas.grab ( boolean  flag) [inline]

Create a background image for the Movertool, consisting of the current construction.

This is called when moving with the control key is called.

Parameters:
flag

Definition at line 3874 of file ZirkelCanvas.java.

       {      if (flag)
              {      OldBackground=Background;
                     Background=createImage(IW,IH);
                     Graphics G=Background.getGraphics();
                     G.drawImage(I,0,0,this);
              }
              else
              {      Background=OldBackground;
                     OldBackground=null;
              }
              repaint();
       }

Here is the caller graph for this function:

Definition at line 2901 of file ZirkelCanvas.java.

       {      return Macros.size()>0;
       }

Here is the caller graph for this function:

Definition at line 2905 of file ZirkelCanvas.java.

       {      Enumeration e=Macros.elements();
              while (e.hasMoreElements())
              {      MacroItem m=(MacroItem)e.nextElement();
                     if (!m.M.isProtected()) return true;
              }
              return false;
       }

Here is the caller graph for this function:

Definition at line 208 of file ZirkelCanvas.java.

       {      return IH;
       }

Here is the caller graph for this function:

void rene.zirkel.ZirkelCanvas.hideDuplicates ( ConstructionObject  from) [inline]

Definition at line 4080 of file ZirkelCanvas.java.

       {      Enumeration e=C.elements();
              if (from!=null)
              {      while (e.hasMoreElements())
                     {      ConstructionObject o=(ConstructionObject)e.nextElement();
                            if (o==from) break;
                     }
              }
              while (e.hasMoreElements())
              {      ConstructionObject o=(ConstructionObject)e.nextElement();
                     if (o.mustHide(this) || o.isKeep()) continue;
                     Enumeration ex=C.elements();
                     while (ex.hasMoreElements())
                     {      ConstructionObject o1=(ConstructionObject)ex.nextElement();
                            if (o1==o) break;
                            if (o1.mustHide(this) || o1.isKeep()) continue;
                            if (o.equals(o1))
                            {      o.setHidden(true);
                                   break;
                            }
                     }
              }
       }

Here is the caller graph for this function:

Definition at line 4104 of file ZirkelCanvas.java.

       {      hideDuplicates(null);
       }

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 4164 of file ZirkelCanvas.java.

       {      if (MW!=null)
              {      MW.setVisible(false); MW.dispose();
                     MW=null;
              }
       }

Here is the caller graph for this function:

boolean rene.zirkel.ZirkelCanvas.hides ( ConstructionObject  o) [inline]

With this it is possible to hide all non-constructable items.

This function is called from any object to see if it has to hide.

Definition at line 2396 of file ZirkelCanvas.java.

       {      if (OC instanceof SetTargetsTool) return !o.isFlag();
              else return false;
       }

Here is the caller graph for this function:

void rene.zirkel.ZirkelCanvas.indicate ( MyVector  v,
boolean  showname 
) [inline]

Definition at line 1894 of file ZirkelCanvas.java.

       {      if (v.size()==1)
              {      if (showname)
                            setCursor(new Cursor(Cursor.CROSSHAIR_CURSOR));
                     else if (v.elementAt(0) instanceof PointObject)
                            setCursor(new Cursor(Cursor.HAND_CURSOR));                            
              }
              else
                     setCursor(Cursor.getDefaultCursor());
              if (Indicated.equalsIdentical(v)) return;
              Enumeration e=Indicated.elements();
              while (e.hasMoreElements())
                     ((ConstructionObject)e.nextElement()).setIndicated(false);
              Indicated.removeAllElements();
              e=v.elements();
              while (e.hasMoreElements())
              {      ConstructionObject o=(ConstructionObject)e.nextElement();
                     Indicated.addElement(o);
                     o.setIndicated(true,showname);
              }
              repaint();
       }

Here is the caller graph for this function:

void rene.zirkel.ZirkelCanvas.indicate ( MyVector  v) [inline]

Definition at line 1917 of file ZirkelCanvas.java.

       {      indicate(v,false);
       }

Here is the call graph for this function:

Here is the caller graph for this function:

void rene.zirkel.ZirkelCanvas.indicateCircleLineObjects ( int  x,
int  y 
) [inline]

Definition at line 2048 of file ZirkelCanvas.java.

       {      MyVector w=selectCircleLineObjects(x,y);
              filter(V,x,y);
              indicate(w);
       }

Here is the call graph for this function:

void rene.zirkel.ZirkelCanvas.indicateCircles ( int  x,
int  y 
) [inline]

Definition at line 2128 of file ZirkelCanvas.java.

       {      selectCircles(x,y,true);
              filter(V,x,y);
              indicate(V);
       }

Here is the call graph for this function:

void rene.zirkel.ZirkelCanvas.indicateConstructableObjects ( int  x,
int  y 
) [inline]

Definition at line 2156 of file ZirkelCanvas.java.

Here is the call graph for this function:

Here is the caller graph for this function:

void rene.zirkel.ZirkelCanvas.indicateCreatePoint ( int  x,
int  y,
boolean  multiple 
) [inline]

Definition at line 2000 of file ZirkelCanvas.java.

       {      Enumeration e=C.elements();
              V.removeAllElements();
              while (e.hasMoreElements())
              {      ConstructionObject o=(ConstructionObject)e.nextElement();
                     if (o.isSelectable() && o instanceof PointObject && o.nearto(x,y,this)
                            && (multiple || !o.selected()))
                     {      V.addElement(o);
                     }
                     sort(V);
              }
              if (V.size()>0)
              {      IndicatePoint=null;
                     filter(V,x,y,false);
                     indicate(V);
                     return;
              }
              PointObject oc=(PointObject)indicateTryCreateIntersection(x,y,true);
              if (oc!=null) return;
              MyVector w=selectPointonObjects(x,y,true,false);
              filter(w,x,y,true);
              if (w.size()>=1)
              {      if (!w.equalsIdentical(Indicated))
                     {      oc=new PointObject(C,x(x),y(y),
                                   (ConstructionObject)w.elementAt(0));
                            if (ShowGrid && !Global.getParameter("grid.leftsnap",false)) 
                                   oc.snap(this);
                            oc.setUseAlpha(true);
                            oc.validate();
                            oc.setIndicated(true);
                            oc.setType(PointObject.CIRCLE);
                            oc.setColorType(ConstructionObject.THICK);
                            IndicatePoint=oc;
                            indicate(w);
                     }
                     else if (IndicatePoint!=null)
                     {      IndicatePoint.setType(PointObject.CIRCLE);
                            IndicatePoint.setColorType(ConstructionObject.THICK);
                            IndicatePoint.move(x(x),y(y));
                            IndicatePoint.project((ConstructionObject)w.elementAt(0));
                            repaint();
                     }
              }
              else
              {      clearIndicated();
              }
       }

Here is the call graph for this function:

Here is the caller graph for this function:

void rene.zirkel.ZirkelCanvas.indicateIntersectedObjects ( int  x,
int  y 
) [inline]

Definition at line 2060 of file ZirkelCanvas.java.

       {      MyVector w=selectPointonObjects(x,y);
              if (!w.equalsIdentical(Indicated) && w.size()>=2)
              {      IntersectionObject o[]=IntersectionConstructor.construct(
                            (ConstructionObject)w.elementAt(0),
                            (ConstructionObject)w.elementAt(1),C);
                     IntersectionObject oc=o[0];
                     if (o.length==2)
                     {      double d0=o[0].distanceTo(x,y,this),
                                   d1=o[1].distanceTo(x,y,this);
                            if (d1<d0) oc=o[1];
                            oc.autoAway();
                     }
                     oc.validate();
                     oc.setDefaults();
                     oc.setIndicated(true);
                     oc.setColorType(ConstructionObject.THICK);
                     oc.setType(PointObject.CIRCLE);
                     IndicatePoint=oc;
              }
              else
              {      IndicatePoint=null;
              }
              indicate(w);
       }

Here is the call graph for this function:

Here is the caller graph for this function:

void rene.zirkel.ZirkelCanvas.indicateLineObjects ( int  x,
int  y 
) [inline]

Definition at line 2086 of file ZirkelCanvas.java.

       {      selectLineObjects(x,y,true);
              filter(V,x,y);
              indicate(V);
       }

Here is the call graph for this function:

Here is the caller graph for this function:

void rene.zirkel.ZirkelCanvas.indicateMoveableObjects ( int  x,
int  y,
boolean  control 
) [inline]

Definition at line 2134 of file ZirkelCanvas.java.

       {      selectMoveableObjects(x,y,control);
              filter(V,x,y);
              indicate(V);
       }

Here is the call graph for this function:

Here is the caller graph for this function:

void rene.zirkel.ZirkelCanvas.indicateMoveableObjects ( int  x,
int  y 
) [inline]

Definition at line 2139 of file ZirkelCanvas.java.

Here is the call graph for this function:

Here is the caller graph for this function:

void rene.zirkel.ZirkelCanvas.indicateObjects ( int  x,
int  y,
boolean  showname 
) [inline]

Definition at line 2162 of file ZirkelCanvas.java.

       {      selectObjects(x,y);
              filter(V,x,y);
              indicate(V,showname);
       }

Here is the call graph for this function:

Here is the caller graph for this function:

void rene.zirkel.ZirkelCanvas.indicateObjects ( int  x,
int  y 
) [inline]

Definition at line 2168 of file ZirkelCanvas.java.

       {      indicateObjects(x,y,false);
       }

Here is the call graph for this function:

Here is the caller graph for this function:

void rene.zirkel.ZirkelCanvas.indicatePointObjects ( int  x,
int  y 
) [inline]

Definition at line 2092 of file ZirkelCanvas.java.

Here is the call graph for this function:

Here is the caller graph for this function:

void rene.zirkel.ZirkelCanvas.indicatePointObjects ( int  x,
int  y,
ConstructionObject  until 
) [inline]

Definition at line 2098 of file ZirkelCanvas.java.

       {      selectPointObjects(x,y,true,until);
              filter(V,x,y);
              indicate(V);
       }

Here is the call graph for this function:

void rene.zirkel.ZirkelCanvas.indicatePointonObjects ( int  x,
int  y 
) [inline]

Definition at line 2054 of file ZirkelCanvas.java.

       {      MyVector w=selectPointonObjects(x,y);
              filter(V,x,y);
              indicate(w);
       }

Here is the call graph for this function:

void rene.zirkel.ZirkelCanvas.indicatePointsOrLines ( int  x,
int  y 
) [inline]

Definition at line 2104 of file ZirkelCanvas.java.

Here is the call graph for this function:

Here is the caller graph for this function:

void rene.zirkel.ZirkelCanvas.indicateRays ( int  x,
int  y 
) [inline]

Definition at line 2116 of file ZirkelCanvas.java.

       {      selectRays(x,y,true);
              filter(V,x,y);
              indicate(V);
       }

Here is the call graph for this function:

void rene.zirkel.ZirkelCanvas.indicateSegments ( int  x,
int  y 
) [inline]

Definition at line 2110 of file ZirkelCanvas.java.

       {      selectSegments(x,y,true);
              filter(V,x,y);
              indicate(V);
       }

Here is the call graph for this function:

ConstructionObject rene.zirkel.ZirkelCanvas.indicateTryCreateIntersection ( int  x,
int  y,
boolean  ask 
) [inline]

Definition at line 1966 of file ZirkelCanvas.java.

       {      MyVector w=selectPointonObjects(x,y,true,true);
              sort(w);
              IntersectionYes=true;
              if (w.size()<2) return null;
              IntersectionObject o[]=IntersectionConstructor.construct(
                     (ConstructionObject)w.elementAt(0),
                     (ConstructionObject)w.elementAt(1),C);
              if (o.length==1 && !o[0].valid()) return null;
              if (o.length==2)
              {      if (!o[1].valid())
                     {      if (!o[0].valid()) return null;
                     }
                     else
                     {      IntersectionObject h=o[0];
                            o[0]=o[1]; o[1]=h;
                     }
              }
              IntersectionObject oc=o[0];
              if (o.length==2 && o[1].valid())
              {      double d0=o[0].distanceTo(x,y,this),
                            d1=o[1].distanceTo(x,y,this);
                     if (d1<d0) oc=o[1];
              }
              oc.setDefaults();
              oc.setIndicated(true);
              oc.setType(PointObject.CIRCLE);
              oc.setColorType(ConstructionObject.THICK);
              IndicatePoint=oc;
              indicate(w);
              oc.validate(x(x),y(y));
              return oc;
       }

Here is the call graph for this function:

Here is the caller graph for this function:

void rene.zirkel.ZirkelCanvas.indicateTwoPointLines ( int  x,
int  y 
) [inline]

Definition at line 2122 of file ZirkelCanvas.java.

Here is the call graph for this function:

void rene.zirkel.ZirkelCanvas.indicateWithSelector ( int  x,
int  y,
Selector  sel 
) [inline]

Definition at line 2143 of file ZirkelCanvas.java.

       {      selectWithSelector(x,y,sel,false);
              filter(V,x,y);
              indicate(V);
       }

Here is the call graph for this function:

Here is the caller graph for this function:

void rene.zirkel.ZirkelCanvas.indicateWithSelector ( int  x,
int  y,
Selector  sel,
ConstructionObject  until 
) [inline]

Definition at line 2149 of file ZirkelCanvas.java.

       {      selectWithSelector(x,y,sel,until,false);
              filter(V,x,y);
              indicate(V);
       }

Here is the call graph for this function:

Definition at line 2770 of file ZirkelCanvas.java.

       {      Enumeration e=Targets.elements();
              while (e.hasMoreElements())
              {      if (((String)e.nextElement()).equals(s))
                            return true;
              }
              return false;
       }

Here is the caller graph for this function:

boolean rene.zirkel.ZirkelCanvas.isInside ( double  x,
double  y 
) [inline]

Definition at line 241 of file ZirkelCanvas.java.

       {      return x>=Xmin && x<Xmin+DX && y>=Ymin && y<Ymin+DY;
       }

Here is the caller graph for this function:

Test, if the construction is a valid job.

Definition at line 2760 of file ZirkelCanvas.java.

       {      Enumeration e=Targets.elements();
              while (e.hasMoreElements())
              {      String s=(String)e.nextElement();
                     if (C.find(s)==null &&
                            (!s.startsWith("~") || C.find(s.substring(1))==null)) return false;
              }
              return Job && C.find(Last)!=null && Targets.size()>0;
       }

Here is the caller graph for this function:

Definition at line 1492 of file ZirkelCanvas.java.

{ return NewPoint; }

Here is the caller graph for this function:

Definition at line 1949 of file ZirkelCanvas.java.

       {      return Preview;
       }

Here is the caller graph for this function:

void rene.zirkel.ZirkelCanvas.itemStateChanged ( ItemEvent  e) [inline]

Definition at line 159 of file ZirkelCanvas.java.

       {      if (e.getSource()==CheckboxHidden)
              {      ShowHidden=CheckboxHidden.getState();
                     repaint();
              }
       }
void rene.zirkel.ZirkelCanvas.load ( InputStream  in,
boolean  construction,
boolean  macros 
) throws Exception [inline]

Definition at line 2504 of file ZirkelCanvas.java.

       {      // System.out.println("read file");
              try
              {      if (construction)
                     {      C.clear(); All=false;
                            paint(getGraphics());
                     }
                     else All=true;
                     XmlReader xml=new XmlReader();
                     xml.init(in);
                     XmlTree tree=xml.scan();
                     if (tree==null)
                            throw new ConstructionException("XML file not recognized");
                     Enumeration e=tree.getContent();
                     while (e.hasMoreElements())
                     {      tree=(XmlTree)e.nextElement();
                            if (tree.getTag() instanceof XmlTagPI) continue;
                            if (!tree.getTag().name().equals("CaR"))
                                   throw new ConstructionException("CaR tag not found");
                            else break;
                     }
                     e=tree.getContent();
                     boolean all=false;
                     while (e.hasMoreElements())
                     {      tree=(XmlTree)e.nextElement();
                            XmlTag tag=tree.getTag();
                            if (tag.name().equals("Macro"))
                            {      if (macros)
                                   {      try
                                          {      Count.setAllAlternate(true);
                                                 Macro m=new Macro(this,tree);
                                                 int i=0;
                                                 for (i=0; i<Macros.size(); i++)
                                                 {      if (((MacroItem)Macros.elementAt(i)).M.getName()
                                                               .equals(m.getName()))
                                                        {      all=replaceMacro(m,i,all);
                                                               break;
                                                        }
                                                 }
                                                 if (i>=Macros.size()) appendMacro(m);
                                          }
                                          catch (ConstructionException ex)
                                          {      Count.setAllAlternate(false);
                                                 throw ex;     
                                          }
                                          Count.setAllAlternate(false);
                                   }
                            }
                            else if (tag.name().equals("Construction"))
                            {      if (construction)
                                   {      boolean job=false;
                                          if (tag.hasParam("job"))
                                          {      job=true;
                                                 Last=tag.getValue("last");
                                                 if (Last==null)
                                                        throw new ConstructionException(
                                                               Zirkel.name("exception.job"));
                                                 String Target=tag.getValue("target");
                                                 if (Target==null)
                                                 {      Targets=new Vector();
                                                        int i=1;
                                                        while (true)
                                                        {      String s=tag.getValue("target"+i);
                                                               i++;
                                                               if (s==null) break;
                                                               Targets.addElement(s);
                                                        }
                                                 }
                                                 else
                                                 {      Targets=new Vector();
                                                        Targets.addElement(Target);
                                                 }
                                                 if (Targets.size()==0)
                                                        throw new ConstructionException(
                                                               Zirkel.name("exception.job"));
                                          }
                                          C.load(tree,this);
                                          if (job)
                                          {      if (C.find(Last)==null)
                                                        throw new ConstructionException(
                                                               Zirkel.name("exception.job"));
                                                 Enumeration et=Targets.elements();
                                                 while (et.hasMoreElements())
                                                 {      String s=(String)et.nextElement();
                                                        if (C.find(s)==null
                                                               && 
                                                               (!s.startsWith("~") ||
                                                               C.find(s.substring(1))==null))
                                                               throw new ConstructionException(
                                                                      Zirkel.name("exception.job"));                                 
                                                 }
                                                 Job=true;
                                          }
                                          break;
                                   }
                            }                    
                            else
                                   throw new ConstructionException(
                                          "Construction not found");
                     }
                     recompute();
                     C.translateOffsets(this);
                     resetSum();
                     validate();
                     repaint();
              }
              catch (Exception e)
              {      throw e;
              }
              reloadCD();
              repaint();
              // System.out.println("finished reading file");
       }

Here is the call graph for this function:

Here is the caller graph for this function:

void rene.zirkel.ZirkelCanvas.load ( InputStream  in) throws Exception [inline]

Definition at line 2639 of file ZirkelCanvas.java.

       {      try
              {      C.Loading=true;
                     load(in,true,true);
                     C.Loading=false;
              }
              catch (Exception e)
              {      C.Loading=false;
                     throw e;
              }
       }

Here is the call graph for this function:

void rene.zirkel.ZirkelCanvas.loadDrawings ( XmlTree  tree) throws ConstructionException [inline]

Definition at line 3950 of file ZirkelCanvas.java.

       {      XmlTag tag=tree.getTag();
              if (!tag.name().equals("Draw")) return;
              Drawing d=new Drawing();
              try
              {      if (tag.hasParam("color"))
                     {      d.setColor(
                                   Integer.parseInt(tag.getValue("color")));
                     }
              }
              catch (Exception e)
              {      throw new ConstructionException("Illegal Draw Parameter");
              }
              Enumeration e=tree.getContent();
              while (e.hasMoreElements())
              {      XmlTree t=(XmlTree)e.nextElement();
                     tag=t.getTag();
                     if (tag.name().equals("Point"))
                     {      try
                            {      double x=new Double(tag.getValue("x")).doubleValue();
                                   double y=new Double(tag.getValue("y")).doubleValue();
                                   d.addXY(x,y);
                            }
                            catch (Exception ex)
                            {      throw new ConstructionException("Illegal Draw Parameter");
                            }
                     }
              }
              Drawings.addElement(d);
       }

Here is the call graph for this function:

Definition at line 172 of file ZirkelCanvas.java.

       {      return ZCI.loadImage();
       }

Here is the call graph for this function:

Here is the caller graph for this function:

void rene.zirkel.ZirkelCanvas.loadMacro ( BufferedReader  in,
String  name 
) throws ConstructionException [inline]

Definition at line 3397 of file ZirkelCanvas.java.

       {      Construction c=new Construction();
              c.clear();
              String s="",comment="",macrocomment="";
              boolean inComment=true,newLine=true;
              while (true)
              {      try
                     {      s=in.readLine();
                            if (s==null)
                                   throw new ConstructionException(
                                          Zirkel.name("exception.macroend"));
                            s=s.trim();
                            int n=s.indexOf("//");
                            if (inComment && n==0)
                            {      String h=s.substring(n+2).trim();
                                   if (newLine)
                                   {      macrocomment=macrocomment+h;
                                          newLine=false;
                                   }
                                   else
                                   {      if (h.equals(""))
                                          {      macrocomment=macrocomment+"\n";
                                                 newLine=true;
                                          }
                                          else
                                          {      macrocomment=macrocomment+" "+h;
                                                 newLine=false;
                                          }
                                   }
                                   continue;
                            }
                            inComment=false;
                            if (n>=0)
                            {      comment=s.substring(n+2).trim();
                                   s=s.substring(0,n);
                            }
                            else comment="";
                            s=s.trim();
                            if (s.equals(Zirkel.name("end"))) break;
                            if (s.toLowerCase().equals("end")) break;
                            if (!s.equals("")) c.interpret(this,s,comment);
                     }
                     catch (InvalidException e)
                     {
                     }
                     catch (ConstructionException e)
                     {      throw new ConstructionException(e.getDescription()+" --- "+s);
                     }
                     catch (IOException e)
                     {      warning(e.toString());
                            return;
                     }
              }
              defineMacro(name,macrocomment,c);
       }

Here is the call graph for this function:

Here is the caller graph for this function:

void rene.zirkel.ZirkelCanvas.loadRun ( InputStream  is) [inline]

Definition at line 3363 of file ZirkelCanvas.java.

       {      BufferedReader in=new BufferedReader(
                     new InputStreamReader(is));
              String s="",comment="";
              while (true)
              {      try
                     {      s=in.readLine();
                            if (s==null) break;
                            int n;
                            if ((n=s.indexOf("//"))>=0)
                            {      comment=s.substring(n+2).trim();
                                   s=s.substring(0,n);
                            }
                            else comment="";
                            s=s.trim();
                            int k=0;
                            if ((k=Interpreter.startTest("macro",s))>=0)
                            {      loadMacro(in,s.substring(k).trim());
                            }
                            else if (!s.equals("")) C.interpret(this,s,comment);
                     }
                     catch (ConstructionException e)
                     {      warning(e.getDescription()+" --- "+s);
                            break;
                     }
                     catch (Exception e)
                     {      warning(e.toString()+" --- "+s);
                            e.printStackTrace();
                            break;
                     }
              }
              C.updateCircleDep();
       }

Here is the call graph for this function:

Here is the caller graph for this function:

void rene.zirkel.ZirkelCanvas.magnify ( double  f) [inline]

Maginify the view by the specified factor.

Definition at line 2680 of file ZirkelCanvas.java.

       {      C.setXYW(C.getX(),C.getY(),C.getW()*f);
              recompute(); validate(); repaint();
       }

Here is the call graph for this function:

Here is the caller graph for this function:

double rene.zirkel.ZirkelCanvas.maxX ( ) [inline]

Definition at line 229 of file ZirkelCanvas.java.

       {      return Xmin+DX;
       }

Here is the caller graph for this function:

double rene.zirkel.ZirkelCanvas.maxY ( ) [inline]

Definition at line 235 of file ZirkelCanvas.java.

       {      return Ymin+DY;
       }

Here is the caller graph for this function:

double rene.zirkel.ZirkelCanvas.minX ( ) [inline]

Definition at line 232 of file ZirkelCanvas.java.

       {      return Xmin;
       }

Here is the caller graph for this function:

double rene.zirkel.ZirkelCanvas.minY ( ) [inline]

Definition at line 238 of file ZirkelCanvas.java.

       {      return Ymin;
       }

Here is the caller graph for this function:

synchronized void rene.zirkel.ZirkelCanvas.mouseClicked ( MouseEvent  e) [inline]

Definition at line 494 of file ZirkelCanvas.java.

{}
synchronized void rene.zirkel.ZirkelCanvas.mouseDragged ( MouseEvent  e) [inline]

Definition at line 520 of file ZirkelCanvas.java.

       {      if (!Interactive) return;
              if (DT==null) DT=new DragThread(this);
              if (SmartBoardPreview 
                     && Global.getParameter("smartboard",false)) 
                            OC.mouseMoved(e,this,
                                   Global.getParameter("options.indicate.simple",false));
              else 
              {      DT.mouseDragged(e);
                     Moved++;
              }
              repaintCD();
       }

Here is the call graph for this function:

void rene.zirkel.ZirkelCanvas.mouseEntered ( MouseEvent  e) [inline]

Definition at line 506 of file ZirkelCanvas.java.

{}
synchronized void rene.zirkel.ZirkelCanvas.mouseExited ( MouseEvent  e) [inline]

Definition at line 496 of file ZirkelCanvas.java.

       {      if (!Interactive) return;
              clearIndicated();
              clearPreview();
              repaint();
              SmartBoardPreview=false;
              RightClicked=false;
              repaintCD();
       }

Here is the call graph for this function:

synchronized void rene.zirkel.ZirkelCanvas.mouseMoved ( MouseEvent  e) [inline]

Definition at line 508 of file ZirkelCanvas.java.

       {      if (!Interactive ||
                     !Global.getParameter("options.indicate",true)) return;
              if (Global.getParameter("smartboard",false)) return;
              Count.setAllAlternate(true);
              OC.mouseMoved(e,this,Global.getParameter("options.indicate.simple",false));
              Count.setAllAlternate(false);
              repaintCD();
       }

Here is the call graph for this function:

synchronized void rene.zirkel.ZirkelCanvas.mousePressed ( MouseEvent  e) [inline]

Definition at line 364 of file ZirkelCanvas.java.

       {      if (!Interactive) return;
              SmartBoardPreview=false;
              clearIndicated();
              clearPreview();
              repaint();
              requestFocus();
              Dragging=false;
              RightClicked=false;
              Moved=0;
              if (e.isMetaDown() && AllowRightMouse) // right mouse button!
              {      if (!ReadOnly)
                     {      ConstructionObject o=selectLabel(e.getX(),e.getY());
                            if (o!=null)
                            {      Dragging=true;
                                   setTool(new LabelMover(OC,this,e.getX(),e.getY(),
                                          o,e.isShiftDown()));
                                   return;
                            }
                            if (e.isShiftDown() && e.isControlDown()) // hiding shortcut
                            {      o=selectObject(e.getX(),e.getY());
                                   if (o==null) return;
                                   o.toggleHidden();
                                   repaint();
                                   return;
                            }
                            if (e.isControlDown()) // edit conditionals
                            {      o=selectObject(e.getX(),e.getY());
                                   if (o==null) return;
                                   new EditConditionals(getFrame(),o);
                                   validate();
                                   repaint();
                                   return;
                            }
                     }
                     ConstructionObject p=selectImmediateMoveableObject(
                            e.getX(),e.getY());
                     RightClicked=true;
                     if (p!=null)
                     {      Dragging=true;
                            setTool(new MetaMover(OC,this,p,e));
                            return;
                     }
                     else if (!Global.getParameter("options.nomousezoom",false)) // Drag mit rechter Maustaste
                     {      if (selectObjects(e.getX(),e.getY()).size()==0)
                            {      setTool(new ZoomerTool(OC,e,this));
                            }
                            return;
                     }
              }
              else // left mouse button!
              {      if (!SmartBoardPreview && Global.getParameter("smartboard",false) 
                            && OC.useSmartBoard())
                     {      OC.mouseMoved(e,this,
                                   Global.getParameter("options.indicate.simple",false));
                            SmartBoardPreview=true;
                            return;
                     }
                     else
                     {      Control=e.isControlDown();
                            OC.mousePressed(e,this); // pass to ObjectConstructor
                            Control=false;
                     }
              }
       }

Here is the call graph for this function:

synchronized void rene.zirkel.ZirkelCanvas.mouseReleased ( MouseEvent  e) [inline]

Definition at line 430 of file ZirkelCanvas.java.

       {      if (!Interactive) return;
              if (DT!=null) DT.waitReady();
              if (RightClicked)
              {      RightClicked=false;
                     OC.mouseReleased(e,this);
                     if (Moved<=2 && AllowRightMouse && !ReadOnly)
                     {      MyVector v=selectObjects(e.getX(),e.getY());
                            if (v.size()>0)
                            {      ConstructionObject o=select(v,e.getX(),e.getY());
                                   if (o!=null)
                                   {      new EditTool().mousePressed(e,o,this);
                                          check();
                                          return;
                                   }
                                   else
                                   repaintCD();
                                   return;
                            }
                     }
                     if (Moved<=2 && PM!=null && !Global.getParameter("restricted",false))
                     {      int n=2;
                            if (ReadOnly || !Global.getParameter("options.doubleclick",false))
                                   n=1;
                            if (e.getClickCount()>=n && 
                                          (ReadOnly || Macros.size()!=0))
                                   PM.show(e.getComponent(),e.getX(),e.getY());
                     }
                     repaintCD();
                     return;
              }
              if (SmartBoardPreview && Global.getParameter("smartboard",false))
              {      Control=e.isControlDown();
                     clearIndicated();
                     clearPreview();
                     repaint();
                     Dragging=false;
                     OC.mousePressed(e,this);
                     SmartBoardPreview=false;
                     mouseReleased(e);
                     return;
              }
              if (!Dragging)
              {      OC.mouseReleased(e,this);
                     Dragging=false;
                     repaintCD();
                     return;
              }
              if (Moved<=1)
              {      if (OC instanceof LabelMover)
                     {      ((LabelMover)OC).resetPoint();
                            OC.mouseReleased(e,this);
                     }
                     else if (OC instanceof MetaMover)
                     {      OC.mouseReleased(e,this);
                            if (!ReadOnly) new EditTool().mousePressed(e,this);
                     }
              }
              else OC.mouseReleased(e,this);
              repaintCD();
              check();
              Dragging=false;
       }

Here is the call graph for this function:

void rene.zirkel.ZirkelCanvas.mouseWheelMoved ( MouseWheelEvent  e) [inline]

Definition at line 4213 of file ZirkelCanvas.java.

       {      if (Global.getParameter("options.nomousezoom",false)) return;
              if (e.getScrollType()==MouseWheelEvent.WHEEL_BLOCK_SCROLL)
              {      if (e.getWheelRotation()<0)
                     {      magnify(1/Math.sqrt(Math.sqrt(2)));
                     }
                     else
                     {      magnify(Math.sqrt(Math.sqrt(2)));
                     }
              }
              else
              {      int n=e.getScrollAmount();
                     if (e.getWheelRotation()<0)
                     {      magnify(1/Math.pow(2,n/12.));
                     }
                     else
                     {      magnify(Math.pow(2,n/12.));
                     }
              }
       }

Here is the call graph for this function:

void rene.zirkel.ZirkelCanvas.movePreview ( MouseEvent  e) [inline]

Definition at line 1936 of file ZirkelCanvas.java.

       {      if (PreviewObject!=null)
              {      PreviewObject.move(x(e.getX()),y(e.getY()));
                     validate();
                     repaint();
              }
       }

Here is the call graph for this function:

Here is the caller graph for this function:

boolean rene.zirkel.ZirkelCanvas.needed ( Construction  c,
ConstructionObject  o,
ConstructionObject  besides 
) [inline]

See, if this secondary parameter "o" is needed in the construction "c" by either a constructable object, or a parameter different from "besides".

Definition at line 3134 of file ZirkelCanvas.java.

       {      Enumeration e=c.elements();
              while (e.hasMoreElements())
              {      ConstructionObject u=(ConstructionObject) e.nextElement();
                     if (!u.isFlag() || u==besides) continue;
                     if (c.dependsDirectlyOn(u,o)) return true;
              }
              return false;
       }

Here is the caller graph for this function:

Definition at line 540 of file ZirkelCanvas.java.

       {      I=null; repaint();
       }

Here is the caller graph for this function:

Definition at line 4144 of file ZirkelCanvas.java.

       {      if (!C.Loading) reloadCD();
       }

Here is the call graph for this function:

synchronized void rene.zirkel.ZirkelCanvas.paint ( Graphics  g) [inline]

Definition at line 556 of file ZirkelCanvas.java.

       {      if (Frozen) return;
              int w=getSize().width,h=getSize().height;
              if (I==null || IW!=w || IH!=h)
              {      if (w==0 || h==0) return;
                     IW=w; IH=h;
                     I=createImage(IW,IH);
                     if (!Global.getParameter("printscalepreview",false)
                            || !Global.getParameter("printscale.sizes",false))
                     {      if (!Global.getParameter("simplegraphics",false))
                            {      IG=new MyGraphics13(I.getGraphics(),this);
                                   IG.setSize(IW,IH);
                            }
                            else
                            {      IG=new MyGraphics11(I.getGraphics());
                                   IG.setSize(IW,IH);
                            }
                            PointSize=IH/PointSizeFactor;
                            FontSize=PointSize*4;
                            MinPointSize=Global.getParameter("minpointsize",3);
                            if (PointSize<MinPointSize) PointSize=MinPointSize;
                            MinFontSize=Global.getParameter("minfontsize",12);
                            if (FontSize<MinFontSize) FontSize=MinFontSize;
                            IG.setDefaultFont((int)FontSize,
                                   Global.getParameter("font.large",false),
                                   Global.getParameter("font.bold",false));
                     }
                     else
                     {      double dpi=IW/
                                   Global.getParameter("printscale.width",5.0);
                            if (!Global.getParameter("simplegraphics",false))
                            {      IG=new MyGraphics13(I.getGraphics(),
                                          Global.getParameter("printscale.linewidth",0.02)*dpi,
                                          this,null);
                                   IG.setSize(IW,IH);
                            }
                            else
                            {      IG=new MyGraphics11(I.getGraphics());
                                   IG.setSize(IW,IH);
                            }
                            PointSize=Global.getParameter("printscale.pointsize",0.07)*dpi;
                            FontSize=Global.getParameter("printscale.textsize",0.3)*dpi;
                            IG.setDefaultFont((int)FontSize,
                                   Global.getParameter("font.large",false),
                                   Global.getParameter("font.bold",false));
                     }
                     recompute();
                     C.dovalidate();
              }
              IG.clearRect(0,0,IW,IH,getBackground());                
              if (Background!=null)
              {      int bw=Background.getWidth(this),
                            bh=Background.getHeight(this);
                     if (bw==IW && bh==IH)
                     {      IG.drawImage(Background,0,0,this);
                     }
                     else if (Global.getParameter("background.tile",true)
                            && bw<IW && bh<IH)
                     {      for (int i=(IW%bw)/2-bw; i<IW; i+=bw)
                                   for (int j=(IH%bh)/2-bh; j<IH; j+=bh)
                                          IG.drawImage(Background,i,j,this);
                     }
                     else if (Global.getParameter("background.center",true))
                     {      IG.drawImage(Background,(IW-bw)/2,(IH-bh)/2,this);
                     }
                     else
                     {      IG.drawImage(Background,0,0,IW,IH,this);
                     }
              }
              if (MW==null) 
              {      C.computeTracks(this);
                     dopaint(IG);
              }
              if (Global.getParameter("printscale.middle",false) &&
                     Global.getParameter("printscalepreview",false))
              {      
                     //IG.setColor(Color.red);
                     int PW=Global.getParameter("printscale.w",IW);
                     int PH=Global.getParameter("printscale.h",IH);
                     IG.drawRect(IW/2-PW/2-3,IH/2-PH/2-3,PW+7,PH+7);
              }
              g.drawImage(I,0,0,this);
       }

Here is the call graph for this function:

Here is the caller graph for this function:

void rene.zirkel.ZirkelCanvas.paintAxes ( MyGraphics  IG) [inline, package]

Paint only the coordinate axes (no grid)

Parameters:
IG

Definition at line 940 of file ZirkelCanvas.java.

       {      if (GridThickness==ConstructionObject.NORMAL)
                     IG.setColor(ZirkelFrame.Colors[GridColor]);
              else
                     IG.setColor(ZirkelFrame.LightColors[GridColor]);               
              IG.setFont(GridLarge,GridBold);
              double gridsize=getGridSize();
              double x1=Math.floor(
                     (C.getX()-C.getW())/gridsize-1)*gridsize;
              int r0=(int)row(0);
              //int dd=IH/200;
              // evers 14/03/2008
              int dd=IH;
              //if (dd<1) dd=1;
              while (x1<(C.getX()+C.getW()))
              {      int c=(int)col(x1);
                     IG.drawLine(c,r0-dd,c,r0+dd);
                     x1+=gridsize;
              }
              double y1=Math.floor(
                     (C.getY()-C.getW())/gridsize-1)*gridsize;
              int c0=(int)col(0);
              while (y1<(C.getY()+C.getW()))
              {      int r=(int)row(y1);
                     IG.drawLine(c0-dd,r,c0+dd,r);
                     y1+=gridsize;
              }

              if (GridThickness!=ConstructionObject.INVISIBLE)
              {      if (0<C.getX()+C.getW() && 0>C.getX()-C.getW())
                     {      int c=(int)col(0);
                            if (GridThickness!=ConstructionObject.THICK)
                                   IG.drawLine(c,0,c,IH);
                            else
                                   IG.drawThickLine(c,0,c,IH);
                     }
                     if (0<C.getY()+C.getW() && 0>C.getY()-C.getW())
                     {      int r=(int)row(0);
                            if (GridThickness!=ConstructionObject.THICK)
                                   IG.drawLine(0,r,IW,r);
                            else
                                   IG.drawThickLine(0,r,IW,r);
                     }
              }
              // evers 14/03/2008
              //dd=dd*2;
              double labelsize=Math.pow(10,Math.floor(
                     Math.log(C.getW()*2)/Math.log(10)))/10;
              while (C.getW()*2/labelsize>=10) labelsize*=10;
              if (C.getW()*2/labelsize<5) labelsize/=2;
              FontMetrics fm=IG.getFontMetrics();
              int FH=fm.getHeight();
              x1=Math.floor(
                     (C.getX()-C.getW())/labelsize-1)*labelsize;
              int lh=(int)row(0);
              if (lh<0 || lh>IH-FH){      lh=IH-FH; }
              while (x1<(C.getX()+C.getW()))
              {      int c=(int)col(x1);
                     String s=format(x1);
                     if (GridLabels)      IG.drawString(s,c+4,lh+FH);
                     if (s.length()>0) IG.drawLine(c,lh-dd,c,lh+dd);
                     x1+=labelsize;
              }
              int lw=(int)col(0);
              if (lw<0 || lw>IW-20)
              {      lw=0;
              }
              y1=Math.floor(
                     (C.getY()-C.getW())/labelsize-1)*labelsize;
              while (y1<(C.getY()+C.getW()))
              {      int r=(int)row(y1);
                     String s=format(y1);
                     if (GridLabels) IG.drawString(s,lw+3,r+FH);
                     if (s.length()>0) IG.drawLine(lw-dd,r,lw+dd,r);
                     y1+=labelsize;
              }

       }

Here is the call graph for this function:

Here is the caller graph for this function:

synchronized void rene.zirkel.ZirkelCanvas.paintDrawings ( MyGraphics  g) [inline]

Definition at line 3912 of file ZirkelCanvas.java.

       {      Enumeration e=Drawings.elements();
              while (e.hasMoreElements())
              {      Drawing d=(Drawing)e.nextElement();
                     Enumeration ec=d.elements();
                     if (ec.hasMoreElements())
                     {      g.setColor(ZirkelFrame.Colors[d.getColor()]);
                            CoordinatesXY xy=(CoordinatesXY)ec.nextElement();
                            int c=(int)col(xy.X),r=(int)row(xy.Y);
                            while (ec.hasMoreElements())
                            {      xy=(CoordinatesXY)ec.nextElement();
                                   int c1=(int)col(xy.X),r1=(int)row(xy.Y);
                                   g.drawLine(c,r,c1,r1);
                                   c=c1; r=r1;
                            }
                     }
              }
       }

Here is the call graph for this function:

Here is the caller graph for this function:

void rene.zirkel.ZirkelCanvas.paintGrid ( MyGraphics  IG) [inline, package]

Paint axes and grid.

Parameters:
IG

Definition at line 812 of file ZirkelCanvas.java.

       {
              if (GridThickness==ConstructionObject.NORMAL)
                     IG.setColor(ZirkelFrame.Colors[Global.getParameter("grid.colorindex",0)]);
              else
                     IG.setColor(ZirkelFrame.LightColors[GridColor]);               
              IG.setFont(GridLarge,GridBold);
              double gridsize=getGridSize();
              //int dd=IH/200;
              // evers 14/03/2008
              int dd=IH;
              //if (dd<1) dd=1;
              double x1=Math.floor(
                     (C.getX()-C.getW())/gridsize-1)*gridsize;
              int xi=0;
              while (x1<(C.getX()+C.getW()) && xi<64)
              {      int c=(int)col(x1);
                     xg[xi++]=c;
                     x1+=gridsize;
              }
              double y1=Math.floor(
                     (C.getY()-C.getW())/gridsize-1)*gridsize;
              int yi=0;
              while (y1<(C.getY()+C.getW()) && yi<64)
              {      int r=(int)row(y1);
                     yg[yi++]=r;
                     y1+=gridsize;
              }
              for (int i=0; i<xi; i++)
              {      for (int j=0; j<yi; j++)
                     {      IG.drawLine(xg[i],yg[j]-dd,xg[i],yg[j]+dd);
                            IG.drawLine(xg[i]-dd,yg[j],xg[i]+dd,yg[j]);
                     }
              }
              if (GridThickness!=ConstructionObject.INVISIBLE)
              {      if (0<C.getX()+C.getW() && 0>C.getX()-C.getW())
                     {      int c=(int)col(0);
                            if (GridThickness!=ConstructionObject.THICK)
                                   IG.drawLine(c,0,c,IH);
                            else
                                   IG.drawThickLine(c,0,c,IH);
                     }
                     if (0<C.getY()+C.getW() && 0>C.getY()-C.getW())
                     {      int r=(int)row(0);
                            if (GridThickness!=ConstructionObject.THICK)
                                   IG.drawLine(0,r,IW,r);
                            else
                                   IG.drawThickLine(0,r,IW,r);
                     }
              }

              dd=dd*2;
              double labelsize=Math.pow(10,Math.floor(
                     Math.log(C.getW()*2)/Math.log(10)))/10;
              while (C.getW()*2/labelsize>=10) labelsize*=10;
              if (C.getW()*2/labelsize<5) labelsize/=2;
              FontMetrics fm=IG.getFontMetrics();
              int FH=fm.getHeight();
              x1=Math.floor(
                     (C.getX()-C.getW())/labelsize-1)*labelsize;
              int lh=(int)row(0);
              if (lh<0 || lh>IH-FH){      
                  lh=IH-FH;
              }

              while (x1<(C.getX()+C.getW()))
              {      int c=(int)col(x1);
                     String s=format(x1);
                     if (s.length()>0) 
                     {      if (GridLabels) IG.drawString(s,c+3,lh+FH);
                            IG.drawLine(c,lh-dd,c,lh+dd);
                     }
                     x1+=labelsize;
              }
              int lw=(int)col(0);
              if (lw<0 || lw>IW-20)
              {      lw=0;
              }
              y1=Math.floor((C.getY()-C.getW())/labelsize-1)*labelsize;
              while (y1<(C.getY()+C.getW()))
              {      int r=(int)row(y1);
                     String s=format(y1);
                     if (s.length()>0) 
                     {      if (GridLabels) IG.drawString(s,lw+3,r+FH);
                            IG.drawLine(lw-dd,r,lw+dd,r);
                     }
                     y1+=labelsize;
              }
              //axes jm.evers
              if(!Zirkel.IsApplet){
                  IG.drawThickLine((int)col(0),0,(int)col(0),IH);
                  IG.drawThickLine(0,(int)row(0),IW,(int)row(0));
                  IG.setColor(Color.red);
                  FontMetrics tm=IG.getFontMetrics();
                  int fh=tm.getHeight();
                  String yas=ZirkelApplet.yaxis_text+" ";
                  String xas=ZirkelApplet.xaxis_text;
                  IG.drawString(xas,(double)(col(0) + 3*fh),(double)(row(0) + fh));
                  int sy=yas.length();
                  if(ZirkelApplet.yaxis_text_vertical){
                     String char_y="";int p=0;int begin=0;int end=1;int r=0;
                     while( p < sy ){
                         char_y=yas.substring(begin,end);
                         if(char_y.indexOf(" ") == -1){
                            end++;
                         }
                         else
                         {
                            IG.drawString(char_y,(double)(col(0) - 2*fh),(double)(row(0) - (8*fh) + r*fh));
                            begin=end;
                            end++;
                            r++;
                         }
                         p++;
                     }
                  }
                  else
                  {
                     IG.drawString(yas,(double)(col(0) - (sy*fh)/2),(double)(row(0) - 10*fh));
                  }
              }
              // end jm.evers
       }

Here is the call graph for this function:

Here is the caller graph for this function:

int rene.zirkel.ZirkelCanvas.paintHotEqn ( int  c,
int  r,
Graphics  g 
) [inline]

Definition at line 4182 of file ZirkelCanvas.java.

       {      if (HE==null) return 0;
              return HE.paint(c,r,g);
       }

Here is the call graph for this function:

void rene.zirkel.ZirkelCanvas.paintTrack ( MyGraphics  g) [inline]

Tracker routines: Call the OC (must be a TrackPainter) to paint the object track.

Definition at line 2697 of file ZirkelCanvas.java.

       {      if (!(OC instanceof TrackPainter)) return;
              ((TrackPainter)OC).paint(g,this);
       }

Here is the caller graph for this function:

void rene.zirkel.ZirkelCanvas.paintUntil ( ConstructionObject  o) [inline]

Definition at line 1089 of file ZirkelCanvas.java.

       {      if (LastPaint==o) return;
              LastPaint=o;
              repaint();
       }

Here is the caller graph for this function:

void rene.zirkel.ZirkelCanvas.pause ( boolean  flag) [inline]

Definition at line 3849 of file ZirkelCanvas.java.

       {      OC.pause(flag);
       }

Here is the caller graph for this function:

Definition at line 1020 of file ZirkelCanvas.java.

       {      return PointSize;
       }

Here is the caller graph for this function:

void rene.zirkel.ZirkelCanvas.prepareForPreview ( MouseEvent  e) [inline]

Definition at line 1944 of file ZirkelCanvas.java.

       {      LastNonPreview=C.last();
              Preview=true;
       }

Here is the caller graph for this function:

synchronized void rene.zirkel.ZirkelCanvas.print ( Graphics  g,
int  W,
int  H 
) [inline]

Definition at line 3462 of file ZirkelCanvas.java.

       {      if (IW==0 || I==null) return;
              startWaiting();
              int w=IW,h=IH;
              Scale=(double)W/w;
              PointSize=PointSize*Scale;
              double fontsize=FontSize*Scale;
              MyGraphics mg=new MyGraphics11(g);
              mg.setSize(w,h);
              mg.setDefaultFont((int)(fontsize),
                            Global.getParameter("font.large",false),
                            Global.getParameter("font.bold",false));
              IW=W; IH=H;
              recompute();
              if (Background!=null)
              {      int bw=Background.getWidth(this),
                            bh=Background.getHeight(this);
                     if (bw==IW && bh==IH)
                     {      mg.drawImage(Background,0,0,this);
                     }
                     else if (Global.getParameter("background.tile",true)
                            && bw<IW && bh<IH)
                     {      for (int i=(IW%bw)/2-bw; i<IW; i+=bw)
                                   for (int j=(IH%bh)/2-bh; j<IH; j+=bh)
                                          mg.drawImage(Background,i,j,this);
                     }
                     else if (Global.getParameter("background.center",true))
                     {      mg.drawImage(Background,(IW-bw)/2,(IH-bh)/2,this);
                     }
                     else
                     {      mg.drawImage(Background,0,0,IW,IH,this);
                     }
              }
              dopaint(mg);
              Interactive=true;
              Scale=1.0;
              I=null;
              endWaiting();
              repaint();
       }

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 3318 of file ZirkelCanvas.java.

       {      Enumeration e=Macros.elements();
              while (e.hasMoreElements())
              {      MacroItem m=(MacroItem)e.nextElement();
                     m.M.setProtected(true);
              }
       }
void rene.zirkel.ZirkelCanvas.range ( PrimitiveCircleObject  c) [inline]

Definition at line 3832 of file ZirkelCanvas.java.

       {      setTool(new SetRangeTool(this,c,OC));
       }

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 249 of file ZirkelCanvas.java.

       {      if (IH<IW)
              {      Xmin=C.getX()-C.getW();
                     DX=C.getW()*2;
                     DY=DX/IW*IH;
                     Ymin=C.getY()-DY/2;
              }
              else
              {      Ymin=C.getY()-C.getW();
                     DY=C.getW()*2;
                     DX=DY/IH*IW;
                     Xmin=C.getX()-DY/2;
              }
              C.setH(DY);
              if (DX>0) C.setPixel(getSize().width/DX);
       }

Here is the call graph for this function:

Here is the caller graph for this function:

boolean rene.zirkel.ZirkelCanvas.rekformat ( double  h,
int  k 
) [inline, package]

Definition at line 1064 of file ZirkelCanvas.java.

       {      h=h*10;
              double x=Math.floor(h);
              if (k==0)
              {      int i=(int)x;
                     if (i>0)
                     {      c[nc++]=(char)('0'+i);
                            return true;
                     }
                     else return false;
              }
              else
              {      int i=(int)x;
                     if (rekformat(h-x,k-1) || i>0)
                     {      c[nc++]=(char)('0'+i);
                            return true;
                     }
                     else return false;
              }
       }

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 4191 of file ZirkelCanvas.java.

       {      if (CDP!=null && C!=null)
              {      CDP.reload();
              }
       }

Here is the caller graph for this function: