Back to index

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

List of all members.

Public Member Functions

 FunctionEditDialog (ZirkelCanvas zc, UserFunctionObject o)
void addFirst (Panel P)
void setAction ()
void focusGained (FocusEvent e)
 Override to set the focus somewhere.
void doAction (String o)
void addSecond (Panel P)
void addButton (Panel p)
void iconPressed (String o)
void showValue ()
boolean showsValue ()
boolean wantsMore ()
void showHelp ()
void windowActivated (WindowEvent e)
void windowClosed (WindowEvent e)
void windowClosing (WindowEvent e)
void windowDeactivated (WindowEvent e)
void windowDeiconified (WindowEvent e)
void windowIconified (WindowEvent e)
void windowOpened (WindowEvent e)
boolean close ()
boolean escape ()
 Calls close(), when the escape key is pressed.
void actionPerformed (ActionEvent e)
void itemAction (String o, boolean flag)
void keyPressed (KeyEvent e)
void keyReleased (KeyEvent e)
void keyTyped (KeyEvent e)
void doclose ()
 Closes the dialog.
void center (Frame f)
void center ()
void centerOut (Frame f)
void notePosition (String name)
 Note window position in Global.
void setPosition (String name)
 Set window position and size.
void focusLost (FocusEvent e)
void noteSize (String name)
 Note window size in Global.
void setSize (String name)
 Set window size.
void setDispose (boolean flag)
 This inihibits dispose(), when the dialog is closed.
boolean isAborted ()
void addHelp (Panel p, String subject)
 To add a help button to children.

Static Public Member Functions

static void center (Frame f, Dialog dialog)

Public Attributes

boolean Aborted = false
String Subject = ""
ActionEvent E

Protected Attributes

MyTextField Text
TextFieldAction Name
ConstructionObject O
IconBar ColorIB
Frame F
boolean More
ButtonAction OK
boolean SuperHide = false

Package Attributes

TextField Var
TextField EY
TextField X
TextField Y
IconBar IC
ZirkelCanvas ZC
Checkbox Fixed
MyTextField Unit
MyTextField Equation
TextFieldAction Alias
IconBar ThicknessIB
IconBar IB
boolean HideChanged = false
boolean HidingBreak = false
boolean BreakChanged = false
boolean OKControlDown = false
boolean Dispose = true

Detailed Description

Definition at line 18 of file UserFunctionObject.java.


Constructor & Destructor Documentation

Definition at line 24 of file UserFunctionObject.java.

       {      super(zc.getFrame(),Zirkel.name("edit.function.title"),o,"function");
              ZC=zc;
       }

Here is the call graph for this function:


Member Function Documentation

void rene.gui.CloseDialog.actionPerformed ( ActionEvent  e) [inline, inherited]
void rene.zirkel.dialogs.ObjectEditDialog.addButton ( Panel  p) [inline, inherited]

Reimplemented from rene.zirkel.dialogs.ObjectEditDialog.

Definition at line 29 of file UserFunctionObject.java.

       {      UserFunctionObject f=(UserFunctionObject)O;
       
              Var=new TextFieldAction(this,"var",""+f.getVar(),30);
              P.add(new MyLabel(Zirkel.name("function.vars"))); P.add(Var);
              EY=new TextFieldAction(this,"ey",""+f.getEY(),30);
              P.add(new MyLabel(Zirkel.name("function.f"))); P.add(EY);
              
              X=new TextFieldAction(this,"X",""+f.round(f.getX()));
              P.add(new MyLabel(Zirkel.name("edit.point.x"))); P.add(X);
              Y=new TextFieldAction(this,"Y",""+f.round(f.getY()));
              P.add(new MyLabel(Zirkel.name("edit.point.y"))); P.add(Y);
              
              Fixed=new Checkbox("");
              Fixed.setState(f.fixed());
              P.add(new MyLabel(Zirkel.name("edit.fixed")));
              P.add(Fixed);
              if (f.fixed())
              {      X.setText(f.getEXpos());
                     Y.setText(f.getEYpos());
              }

       }

Here is the call graph for this function:

void rene.gui.CloseDialog.addHelp ( Panel  p,
String  subject 
) [inline, inherited]

To add a help button to children.

Parameters:
p
subject

Definition at line 231 of file CloseDialog.java.

       {      p.add(new MyLabel(""));
              p.add(new ButtonAction(this,Global.name("help"),"Help"));
              Subject=subject;
       }

Here is the call graph for this function:

Here is the caller graph for this function:

void rene.zirkel.dialogs.ObjectEditDialog.addSecond ( Panel  P) [inline, inherited]
void rene.gui.CloseDialog.center ( Frame  f) [inline, inherited]

Reimplemented in rene.dialogs.MyFileDialog.

Definition at line 104 of file CloseDialog.java.

       {      Dimension 
                     si=f.getSize(),
                     d=getSize(),
                     dscreen=getToolkit().getScreenSize();
              Point lo=f.getLocation();
              int x=lo.x+si.width/2-d.width/2;
              int y=lo.y+si.height/2-d.height/2;
              if (x+d.width>dscreen.width) x=dscreen.width-d.width-10;
              if (x<10) x=10;
              if (y+d.height>dscreen.height) y=dscreen.height-d.height-10;
              if (y<10) y=10;
              setLocation(x,y);
       }

Here is the caller graph for this function:

static void rene.gui.CloseDialog.center ( Frame  f,
Dialog  dialog 
) [inline, static, inherited]

Definition at line 118 of file CloseDialog.java.

       {      Dimension 
                     si=f.getSize(),
                     d=dialog.getSize(),
                     dscreen=f.getToolkit().getScreenSize();
              Point lo=f.getLocation();
              int x=lo.x+si.width/2-d.width/2;
              int y=lo.y+si.height/2-d.height/2;
              if (x+d.width>dscreen.width) x=dscreen.width-d.width-10;
              if (x<10) x=10;
              if (y+d.height>dscreen.height) y=dscreen.height-d.height-10;
              if (y<10) y=10;
              dialog.setLocation(x,y);
       }
void rene.gui.CloseDialog.center ( ) [inline, inherited]

Definition at line 144 of file CloseDialog.java.

       {      Dimension d=getSize(),dscreen=getToolkit().getScreenSize();
              setLocation((dscreen.width-d.width)/2,
                     (dscreen.height-d.height)/2);
       }

Here is the caller graph for this function:

void rene.gui.CloseDialog.centerOut ( Frame  f) [inline, inherited]

Definition at line 132 of file CloseDialog.java.

       {      Dimension si=f.getSize(),d=getSize(),
                     dscreen=getToolkit().getScreenSize();
              Point lo=f.getLocation();
              int x=lo.x+si.width-getSize().width+20;
              int y=lo.y+si.height/2+40;
              if (x+d.width>dscreen.width) x=dscreen.width-d.width-10;
              if (x<10) x=10;
              if (y+d.height>dscreen.height) y=dscreen.height-d.height-10;
              if (y<10) y=10;
              setLocation(x,y);
       }
boolean rene.gui.CloseDialog.close ( ) [inline, inherited]
Returns:
true if the dialog is closed.

Reimplemented in rene.dialogs.SearchFileDialog.

Definition at line 47 of file CloseDialog.java.

       {      return true;
       }

Here is the caller graph for this function:

void rene.zirkel.dialogs.ObjectEditDialog.doAction ( String  o) [inline, inherited]

Reimplemented from rene.gui.CloseDialog.

Reimplemented in rene.zirkel.objects.PointEditDialog, rene.zirkel.objects.CurveEditDialog, rene.zirkel.dialogs.CircleEditDialog, rene.zirkel.objects.TextEditDialog, rene.zirkel.objects.ExpressionEditDialog, rene.zirkel.objects.LineEditDialog, rene.zirkel.objects.FixedAngleEditDialog, and rene.zirkel.objects.AngleEditDialog.

Definition at line 148 of file ObjectEditDialog.java.

       {      if (o.equals("OK") || o.equals("Name") || o.equals("Alias") || o.equals("More"))
              {      More=(o.equals("More") || OKControlDown);
                     O.setName(Name.getText());
                     if (Alias!=null)
                     {      if (!Alias.getText().equals(""))
                            {      if (O.getAlias()==null || !O.getAlias().equals(Alias.getText()))
                                          O.setShowName(true);
                                   O.setAlias(Alias.getText());
                            }
                            else O.setAlias(null);
                     }
                     if (o.equals("Name")) IB.setState("showname",true);
                     String text=Text.getText();
                     if (text.equals(""))
                     {      O.setText("",true);
                            O.updateText();
                     }
                     else if (!O.getText().equals(text))
                     {      if (!text.endsWith(" ")) text=text+" ";
                            O.setText(text,true);
                     }
                     O.setUnit(Unit.getText());
                     if (HideChanged)
                     {      O.setHidden(IB.getState("hide"));
                            if (SuperHide && IB.getState("hide")) O.setSuperHidden(true);
                            else O.setSuperHidden(false);
                     }
                     O.setColor(ColorIB.getToggleState("color"));
                     O.setColorType(ThicknessIB.getToggleState("thickness"));
                     O.setShowName(o.equals("Name") || o.equals("Alias") || IB.getState("showname"));
                     O.setBold(IB.getState("bold"));
                     O.setLarge(IB.getState("large"));
                     O.setBack(IB.getState("isback"));
                     if (showsValue()) O.setShowValue(IB.getState("showvalue"));
                     if (O.maybeTransparent())
                     {      O.setSolid(ThicknessIB.getState("solid"));
                     }
                     if (BreakChanged)
                     {      if (IB.getState("setbreak"))
                            {      if (HidingBreak) O.setHideBreak(true);
                                   else O.setBreak(true);
                            }
                            else O.setBreak(false);
                     }
                     doclose();
                     setAction();
              }
              else super.doAction(o);
       }

Here is the call graph for this function:

void rene.gui.CloseDialog.doclose ( ) [inline, inherited]

Closes the dialog.

This may be used in subclasses to do some action. Then call super.doclose()

Reimplemented in rene.dialogs.InfoDialog, rene.dialogs.SearchFileDialog, and rene.zirkel.dialogs.Replay.

Definition at line 92 of file CloseDialog.java.

       {      setVisible(false);
              // Because of a bug in Linux Java 1.4.2 etc.
              // dispose in a separate thread.
              Thread t=new Thread ()
              {      public void run ()
                     {      if (Dispose) dispose();
                     }
              };
              t.start();
       }

Here is the call graph for this function:

Here is the caller graph for this function:

boolean rene.gui.CloseDialog.escape ( ) [inline, inherited]

Calls close(), when the escape key is pressed.

Returns:
true if the dialog may close.

Reimplemented in rene.zirkel.dialogs.CommentDialog.

Definition at line 55 of file CloseDialog.java.

       {      return close();
       }

Here is the call graph for this function:

Here is the caller graph for this function:

void rene.zirkel.objects.FunctionEditDialog.focusGained ( FocusEvent  e) [inline]

Override to set the focus somewhere.

Reimplemented from rene.gui.CloseDialog.

Definition at line 76 of file UserFunctionObject.java.

       {      Var.requestFocus();
       }
void rene.gui.CloseDialog.focusLost ( FocusEvent  e) [inline, inherited]

Definition at line 191 of file CloseDialog.java.

{}
void rene.zirkel.dialogs.ObjectEditDialog.iconPressed ( String  o) [inline, inherited]

Implements rene.gui.IconBarListener.

Reimplemented in rene.zirkel.dialogs.CircleEditDialog, rene.zirkel.objects.CurveEditDialog, rene.zirkel.objects.FixedAngleEditDialog, rene.zirkel.objects.AngleEditDialog, and rene.zirkel.objects.TrackEditDialog.

Definition at line 203 of file ObjectEditDialog.java.

       {      if (o.equals("hide"))
              {      HideChanged=true;
                     if (IB.isShiftPressed()) SuperHide=IB.getState("hide");
                     else SuperHide=false;
              }
              else if (o.equals("setbreak"))
              {      BreakChanged=true;
                     if (IB.isShiftPressed()) HidingBreak=IB.getState("setbreak");
                     else HidingBreak=false;
              }
       }

Here is the call graph for this function:

boolean rene.gui.CloseDialog.isAborted ( ) [inline, inherited]
void rene.gui.CloseDialog.itemAction ( String  o,
boolean  flag 
) [inline, inherited]
void rene.gui.CloseDialog.keyPressed ( KeyEvent  e) [inline, inherited]

Definition at line 82 of file CloseDialog.java.

       {      if (e.getKeyCode()==KeyEvent.VK_ESCAPE && escape()) doclose();
       }

Here is the call graph for this function:

void rene.gui.CloseDialog.keyReleased ( KeyEvent  e) [inline, inherited]

Definition at line 85 of file CloseDialog.java.

{}
void rene.gui.CloseDialog.keyTyped ( KeyEvent  e) [inline, inherited]

Definition at line 86 of file CloseDialog.java.

{}
void rene.gui.CloseDialog.notePosition ( String  name) [inline, inherited]

Note window position in Global.

Definition at line 153 of file CloseDialog.java.

       {      Point l=getLocation();
              Dimension d=getSize();
              Global.setParameter(name+".x",l.x);
              Global.setParameter(name+".y",l.y);
              Global.setParameter(name+".w",d.width);
              if (d.height-Global.getParameter(name+".h",0)!=19)
                     // works around a bug in Windows
                     Global.setParameter(name+".h",d.height);
              boolean maximized=false;
       }

Here is the call graph for this function:

void rene.gui.CloseDialog.noteSize ( String  name) [inline, inherited]

Note window size in Global.

Definition at line 196 of file CloseDialog.java.

       {      Dimension d=getSize();
              Global.setParameter(name+".w",d.width);
              Global.setParameter(name+".h",d.height);
       }

Here is the call graph for this function:

Here is the caller graph for this function:

Reimplemented from rene.zirkel.dialogs.ObjectEditDialog.

Definition at line 53 of file UserFunctionObject.java.

       {      UserFunctionObject f=(UserFunctionObject)O;
              f.setExpressions(Var.getText(),EY.getText());           
              try
              {      double x=new Double(X.getText()).doubleValue();
                     double y=new Double(Y.getText()).doubleValue();
                     f.move(x,y);
              }
              catch (Exception e) {}
              if (Fixed.getState()==true) f.setFixed(X.getText(),Y.getText());
              else
              {      try
                     {      double x=new Expression(X.getText(),
                                   f.getConstruction(),f).getValue();
                            double y=new Expression(Y.getText(),
                                   f.getConstruction(),f).getValue();
                            f.move(x,y);
                            f.setFixed(false);
                     }
                     catch (Exception e) {}
              }
       }

Here is the call graph for this function:

void rene.gui.CloseDialog.setDispose ( boolean  flag) [inline, inherited]

This inihibits dispose(), when the dialog is closed.

Definition at line 218 of file CloseDialog.java.

       {      Dispose=flag;
       }
void rene.gui.CloseDialog.setPosition ( String  name) [inline, inherited]

Set window position and size.

Definition at line 168 of file CloseDialog.java.

       {      Point l=getLocation();
              Dimension d=getSize();
              Dimension dscreen=getToolkit().getScreenSize();
              int x=Global.getParameter(name+".x",l.x);
              int y=Global.getParameter(name+".y",l.y);
              int w=Global.getParameter(name+".w",d.width);
              int h=Global.getParameter(name+".h",d.height);
              if (w>dscreen.width) w=dscreen.width;
              if (h>dscreen.height) h=dscreen.height;
              if (x<0) x=0;
              if (x+w>dscreen.width) x=dscreen.width-w;
              if (y<0) y=0;
              if (y+h>dscreen.height) y=dscreen.height-h;
              setLocation(x,y);
              setSize(w,h);
       }

Here is the call graph for this function:

void rene.gui.CloseDialog.setSize ( String  name) [inline, inherited]

Set window size.

Definition at line 205 of file CloseDialog.java.

       {      if (!Global.haveParameter(name+".w")) pack();
              else
              {      Dimension d=getSize();
                     int w=Global.getParameter(name+".w",d.width);
                     int h=Global.getParameter(name+".h",d.height);
                     setSize(w,h);
              }
       }

Here is the call graph for this function:

Here is the caller graph for this function:

void rene.zirkel.dialogs.HelpCloseDialog.showHelp ( ) [inline, inherited]

Reimplemented from rene.gui.CloseDialog.

Definition at line 18 of file HelpCloseDialog.java.

       {      Info.Subject=Subject;
              Info id=new Info(F,true);
       }

Reimplemented in rene.zirkel.objects.TextEditDialog, and rene.zirkel.objects.LineEditDialog.

Definition at line 218 of file ObjectEditDialog.java.

       {      return true;
       }

Here is the caller graph for this function:

void rene.zirkel.dialogs.ObjectEditDialog.showValue ( ) [inline, inherited]

Definition at line 215 of file ObjectEditDialog.java.

       {      if (showsValue()) IB.setState("showvalue",true);
       }

Here is the call graph for this function:

Definition at line 222 of file ObjectEditDialog.java.

       {      return More;
       }

Here is the caller graph for this function:

void rene.gui.CloseDialog.windowActivated ( WindowEvent  e) [inline, inherited]

Definition at line 34 of file CloseDialog.java.

{}
void rene.gui.CloseDialog.windowClosed ( WindowEvent  e) [inline, inherited]

Definition at line 35 of file CloseDialog.java.

{}
void rene.gui.CloseDialog.windowClosing ( WindowEvent  e) [inline, inherited]

Definition at line 36 of file CloseDialog.java.

       {   if (close()) doclose();
       }

Here is the call graph for this function:

Here is the caller graph for this function:

void rene.gui.CloseDialog.windowDeactivated ( WindowEvent  e) [inline, inherited]

Definition at line 39 of file CloseDialog.java.

{}
void rene.gui.CloseDialog.windowDeiconified ( WindowEvent  e) [inline, inherited]

Definition at line 40 of file CloseDialog.java.

{}
void rene.gui.CloseDialog.windowIconified ( WindowEvent  e) [inline, inherited]

Definition at line 41 of file CloseDialog.java.

{}
void rene.gui.CloseDialog.windowOpened ( WindowEvent  e) [inline, inherited]

Reimplemented in rene.zirkel.dialogs.DefineMacro.

Definition at line 42 of file CloseDialog.java.

{}

Member Data Documentation

Definition at line 23 of file ObjectEditDialog.java.

Definition at line 30 of file ObjectEditDialog.java.

Definition at line 25 of file ObjectEditDialog.java.

boolean rene.gui.CloseDialog.Dispose = true [package, inherited]

Definition at line 19 of file CloseDialog.java.

ActionEvent rene.gui.CloseDialog.E [inherited]

Reimplemented in rene.dialogs.FontEditor.

Definition at line 59 of file CloseDialog.java.

MyTextField rene.zirkel.dialogs.ObjectEditDialog.Equation [package, inherited]

Definition at line 22 of file ObjectEditDialog.java.

Definition at line 19 of file UserFunctionObject.java.

Frame rene.zirkel.dialogs.ObjectEditDialog.F [protected, inherited]

Reimplemented from rene.zirkel.dialogs.HelpCloseDialog.

Definition at line 26 of file ObjectEditDialog.java.

Definition at line 22 of file UserFunctionObject.java.

Definition at line 29 of file ObjectEditDialog.java.

Definition at line 30 of file ObjectEditDialog.java.

Definition at line 25 of file ObjectEditDialog.java.

Definition at line 20 of file UserFunctionObject.java.

Definition at line 27 of file ObjectEditDialog.java.

Definition at line 23 of file ObjectEditDialog.java.

Definition at line 24 of file ObjectEditDialog.java.

Definition at line 28 of file ObjectEditDialog.java.

Definition at line 30 of file ObjectEditDialog.java.

String rene.gui.CloseDialog.Subject = "" [inherited]

Reimplemented in rene.dialogs.InfoDialog.

Definition at line 22 of file CloseDialog.java.

Definition at line 29 of file ObjectEditDialog.java.

MyTextField rene.zirkel.dialogs.ObjectEditDialog.Text [protected, inherited]

Definition at line 22 of file ObjectEditDialog.java.

Definition at line 25 of file ObjectEditDialog.java.

MyTextField rene.zirkel.dialogs.ObjectEditDialog.Unit [package, inherited]

Definition at line 22 of file ObjectEditDialog.java.

Definition at line 19 of file UserFunctionObject.java.

Definition at line 19 of file UserFunctionObject.java.

Definition at line 19 of file UserFunctionObject.java.

Definition at line 21 of file UserFunctionObject.java.


The documentation for this class was generated from the following file: