org.fraid.plugin
Class BehaviorBean

java.lang.Object
  extended by org.fraid.plugin.BehaviorBean
All Implemented Interfaces:
java.awt.event.ActionListener, java.awt.event.ItemListener, java.awt.event.KeyListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.io.Serializable, java.lang.Cloneable, java.util.EventListener, BehaviorBeanInterface, ChangeAwareObject
Direct Known Subclasses:
AggregationPlotPlugIn, CobWebPlugIn, Color3DPlugIn, ConsumptionDiagramPlugIn, FunctionPlotPlugIn, IterFractPlugIn, JuliaPlugIn, MandelbrotPlugIn, MapPlotPlugIn, NewtonPlugIn, OrbitDiagram2PlugIn, OrbitDiagramPlugIn, PhasePlugIn, Plot2PlugIn, Plot3DPlugIn, PMChartPlugIn, SpectrumPlugIn, TransformPlugIn

public class BehaviorBean
extends java.lang.Object
implements BehaviorBeanInterface, java.io.Serializable, java.lang.Cloneable

The adapter to the plugin interface. All current plugins extend this. All public variables are being persisted. The extending plugins add their specific fields and all this is being persisted to settings files (which you create/edit with the settings editor).

See Also:
Serialized Form

Field Summary
 boolean autoScale
          Are the algorithms trying to adjust the scale automatically (not all of them can).
 java.awt.Color backgroundColor
          The background color.
 DoublePoint bottomRight
          The plane coordinates of the bottom right corner of the region we are painting.
 java.awt.Dimension frameSize
          The size of the image.
 java.awt.Color gridColor
          The color of the grid.
protected  javax.swing.JCheckBoxMenuItem mAutoScaleMenuItem
           
 java.util.Vector<DoublePoint> mGridCrossPoints
          The grid.
protected  PaintAlgorithmThread mPainterThread
          The refernece to the algorithm.
protected  GraphicsUser mPanel
          The reference to the current user.
 int numberGridMarkerDigitsX
          How many digits are there on the grid marks - X.
 int numberGridMarkerDigitsY
          How many digits are there on the grid marks - Y.
 DoublePoint upperLeft
          The plane coordinates of the upper left corner of the region we are painting.
 
Constructor Summary
BehaviorBean()
          Creates a new BehaviourPlugInAdapter instance.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent aE)
           
 java.lang.Object clone()
          Clone when saving to file.
 void completePopupMenu(javax.swing.JPopupMenu aPopup)
          See superclass.
 void copyAlgorithmStructures(PaintAlgorithmThread aAlgorithm)
           
 boolean doActionPerformed(java.awt.event.ActionEvent aE)
           
 boolean doItemStateChanged(java.awt.event.ItemEvent aE)
           
 boolean doKeyPressed(java.awt.event.KeyEvent aE)
           
 boolean doKeyReleased(java.awt.event.KeyEvent aE)
           
 boolean doKeyTyped(java.awt.event.KeyEvent aE)
           
 boolean doMouseClicked(java.awt.event.MouseEvent aE)
           
 boolean doMouseDragged(java.awt.event.MouseEvent aE)
           
 boolean doMouseEntered(java.awt.event.MouseEvent aE)
           
 boolean doMouseExited(java.awt.event.MouseEvent aE)
           
 boolean doMouseMoved(java.awt.event.MouseEvent aE)
           
 boolean doMousePressed(java.awt.event.MouseEvent aE)
           
 boolean doMouseReleased(java.awt.event.MouseEvent aE)
           
 boolean doObjectChanged()
          The actual worker for objectChanged.
 PaintAlgorithmThread getAlgorithm()
          Returns the current algorithm
 java.awt.Color getBackgroundColor()
          Get the BackgroundColor value.
 DoublePoint getBottomRight()
          Get the BottomRight value.
 java.awt.Dimension getFrameSize()
          Get the FrameSize value.
 java.awt.Color getGridColor()
          Get the GridColor value.
 int getNumberGridMarkerDigitsX()
          Get the NumberGridMarkerDigitsX value.
 int getNumberGridMarkerDigitsY()
          Get the NumberGridMarkerDigitsY value.
 java.lang.String getToolTipText(java.awt.event.MouseEvent e)
           
 DoublePoint getUpperLeft()
          Get the UpperLeft value.
 boolean isAutoScale()
          Get the AutoScale value.
 void itemStateChanged(java.awt.event.ItemEvent aE)
           
 void keyPressed(java.awt.event.KeyEvent aE)
           
 void keyReleased(java.awt.event.KeyEvent aE)
           
 void keyTyped(java.awt.event.KeyEvent aE)
           
 void mouseClicked(java.awt.event.MouseEvent aE)
           
 void mouseDragged(java.awt.event.MouseEvent aE)
           
 void mouseEntered(java.awt.event.MouseEvent aE)
           
 void mouseExited(java.awt.event.MouseEvent aE)
           
 void mouseMoved(java.awt.event.MouseEvent aE)
           
 void mousePressed(java.awt.event.MouseEvent aE)
           
 void mouseReleased(java.awt.event.MouseEvent aE)
           
 void objectChanged()
          If we have check boxes or radio buttons on the popup menu they need to get refreshed if their coresponding values changed.
 void setAutoScale(boolean newAutoScale)
          Set the AutoScale value.
 void setBackgroundColor(java.awt.Color newBackgroundColor)
          Set the BackgroundColor value.
 void setBottomRight(DoublePoint newBottomRight)
          Set the BottomRight value.
 void setFrameSize(java.awt.Dimension newFrameSize)
          Set the FrameSize value.
 void setGraphicsPanel(GraphicsUser aPanel)
          See superclass.
 void setGridColor(java.awt.Color newGridColor)
          Set the GridColor value.
 void setLimits(DoublePoint aUl, DoublePoint aBr)
          Sets the corners and checks for consistency.
 void setNumberGridMarkerDigitsX(int newNumberGridMarkerDigitsX)
          Set the NumberGridMarkerDigitsX value.
 void setNumberGridMarkerDigitsY(int newNumberGridMarkerDigitsY)
          Set the NumberGridMarkerDigitsY value.
 void setUpperLeft(DoublePoint newUpperLeft)
          Set the UpperLeft value.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mPanel

protected transient GraphicsUser mPanel
The reference to the current user.


mPainterThread

protected transient PaintAlgorithmThread mPainterThread
The refernece to the algorithm.


mAutoScaleMenuItem

protected transient javax.swing.JCheckBoxMenuItem mAutoScaleMenuItem

mGridCrossPoints

public transient java.util.Vector<DoublePoint> mGridCrossPoints
The grid.


upperLeft

public DoublePoint upperLeft
The plane coordinates of the upper left corner of the region we are painting.


bottomRight

public DoublePoint bottomRight
The plane coordinates of the bottom right corner of the region we are painting.


frameSize

public java.awt.Dimension frameSize
The size of the image.


backgroundColor

public java.awt.Color backgroundColor
The background color.


gridColor

public java.awt.Color gridColor
The color of the grid.


numberGridMarkerDigitsX

public int numberGridMarkerDigitsX
How many digits are there on the grid marks - X.


numberGridMarkerDigitsY

public int numberGridMarkerDigitsY
How many digits are there on the grid marks - Y.


autoScale

public boolean autoScale
Are the algorithms trying to adjust the scale automatically (not all of them can).

Constructor Detail

BehaviorBean

public BehaviorBean()
Creates a new BehaviourPlugInAdapter instance.

Method Detail

isAutoScale

public boolean isAutoScale()
Get the AutoScale value.

Returns:
the AutoScale value.

setAutoScale

public void setAutoScale(boolean newAutoScale)
Set the AutoScale value.

Parameters:
newAutoScale - The new AutoScale value.

getNumberGridMarkerDigitsY

public int getNumberGridMarkerDigitsY()
Get the NumberGridMarkerDigitsY value.

Returns:
the NumberGridMarkerDigitsY value.

setNumberGridMarkerDigitsY

public void setNumberGridMarkerDigitsY(int newNumberGridMarkerDigitsY)
Set the NumberGridMarkerDigitsY value.

Parameters:
newNumberGridMarkerDigitsY - The new NumberGridMarkerDigitsY value.

getNumberGridMarkerDigitsX

public int getNumberGridMarkerDigitsX()
Get the NumberGridMarkerDigitsX value.

Returns:
the NumberGridMarkerDigitsX value.

setNumberGridMarkerDigitsX

public void setNumberGridMarkerDigitsX(int newNumberGridMarkerDigitsX)
Set the NumberGridMarkerDigitsX value.

Parameters:
newNumberGridMarkerDigitsX - The new NumberGridMarkerDigitsX value.

getGridColor

public java.awt.Color getGridColor()
Get the GridColor value.

Returns:
the GridColor value.

setGridColor

public void setGridColor(java.awt.Color newGridColor)
Set the GridColor value.

Parameters:
newGridColor - The new GridColor value.

getBackgroundColor

public java.awt.Color getBackgroundColor()
Get the BackgroundColor value.

Returns:
the BackgroundColor value.

setBackgroundColor

public void setBackgroundColor(java.awt.Color newBackgroundColor)
Set the BackgroundColor value.

Parameters:
newBackgroundColor - The new BackgroundColor value.

getFrameSize

public java.awt.Dimension getFrameSize()
Get the FrameSize value.

Returns:
the FrameSize value.

setFrameSize

public void setFrameSize(java.awt.Dimension newFrameSize)
Set the FrameSize value.

Parameters:
newFrameSize - The new FrameSize value.

getUpperLeft

public DoublePoint getUpperLeft()
Get the UpperLeft value.

Returns:
the UpperLeft value.

setUpperLeft

public void setUpperLeft(DoublePoint newUpperLeft)
Set the UpperLeft value.

Parameters:
newUpperLeft - The new UpperLeft value.

getBottomRight

public DoublePoint getBottomRight()
Get the BottomRight value.

Returns:
the BottomRight value.

setBottomRight

public void setBottomRight(DoublePoint newBottomRight)
Set the BottomRight value.

Parameters:
newBottomRight - The new BottomRight value.

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Clone when saving to file.

Overrides:
clone in class java.lang.Object
Returns:
an Object value
Throws:
java.lang.CloneNotSupportedException - if an error occurs

setGraphicsPanel

public void setGraphicsPanel(GraphicsUser aPanel)
                      throws PlugInException
See superclass.

Specified by:
setGraphicsPanel in interface BehaviorBeanInterface
Parameters:
aPanel - a GraphicsUser value
Throws:
PlugInException - if an error occurs

setLimits

public void setLimits(DoublePoint aUl,
                      DoublePoint aBr)
               throws GraphicsException
Sets the corners and checks for consistency. Use this despite that they are public.

Parameters:
aUl - a DoublePoint value
aBr - a DoublePoint value
Throws:
GraphicsException - if an error occurs

getAlgorithm

public PaintAlgorithmThread getAlgorithm()
Returns the current algorithm

Specified by:
getAlgorithm in interface BehaviorBeanInterface
Returns:
a PaintAlgorithmThread value

getToolTipText

public java.lang.String getToolTipText(java.awt.event.MouseEvent e)

completePopupMenu

public void completePopupMenu(javax.swing.JPopupMenu aPopup)
See superclass.

Specified by:
completePopupMenu in interface BehaviorBeanInterface
Parameters:
aPopup - a JPopupMenu value

objectChanged

public final void objectChanged()
If we have check boxes or radio buttons on the popup menu they need to get refreshed if their coresponding values changed. Used when the SettingsEditor opens a live plugin and changes something.

Specified by:
objectChanged in interface ChangeAwareObject

actionPerformed

public final void actionPerformed(java.awt.event.ActionEvent aE)
Specified by:
actionPerformed in interface java.awt.event.ActionListener

itemStateChanged

public final void itemStateChanged(java.awt.event.ItemEvent aE)
Specified by:
itemStateChanged in interface java.awt.event.ItemListener

mouseClicked

public final void mouseClicked(java.awt.event.MouseEvent aE)
Specified by:
mouseClicked in interface java.awt.event.MouseListener

mouseEntered

public final void mouseEntered(java.awt.event.MouseEvent aE)
Specified by:
mouseEntered in interface java.awt.event.MouseListener

mouseExited

public final void mouseExited(java.awt.event.MouseEvent aE)
Specified by:
mouseExited in interface java.awt.event.MouseListener

mousePressed

public final void mousePressed(java.awt.event.MouseEvent aE)
Specified by:
mousePressed in interface java.awt.event.MouseListener

mouseReleased

public final void mouseReleased(java.awt.event.MouseEvent aE)
Specified by:
mouseReleased in interface java.awt.event.MouseListener

mouseDragged

public final void mouseDragged(java.awt.event.MouseEvent aE)
Specified by:
mouseDragged in interface java.awt.event.MouseMotionListener

mouseMoved

public final void mouseMoved(java.awt.event.MouseEvent aE)
Specified by:
mouseMoved in interface java.awt.event.MouseMotionListener

keyPressed

public final void keyPressed(java.awt.event.KeyEvent aE)
Specified by:
keyPressed in interface java.awt.event.KeyListener

keyReleased

public final void keyReleased(java.awt.event.KeyEvent aE)
Specified by:
keyReleased in interface java.awt.event.KeyListener

keyTyped

public final void keyTyped(java.awt.event.KeyEvent aE)
Specified by:
keyTyped in interface java.awt.event.KeyListener

doObjectChanged

public boolean doObjectChanged()
The actual worker for objectChanged.

Returns:
a boolean value

doActionPerformed

public boolean doActionPerformed(java.awt.event.ActionEvent aE)

doItemStateChanged

public boolean doItemStateChanged(java.awt.event.ItemEvent aE)

doMouseClicked

public boolean doMouseClicked(java.awt.event.MouseEvent aE)

doMouseEntered

public boolean doMouseEntered(java.awt.event.MouseEvent aE)

doMouseExited

public boolean doMouseExited(java.awt.event.MouseEvent aE)

doMousePressed

public boolean doMousePressed(java.awt.event.MouseEvent aE)

doMouseReleased

public boolean doMouseReleased(java.awt.event.MouseEvent aE)

doMouseDragged

public boolean doMouseDragged(java.awt.event.MouseEvent aE)

doMouseMoved

public boolean doMouseMoved(java.awt.event.MouseEvent aE)

doKeyPressed

public boolean doKeyPressed(java.awt.event.KeyEvent aE)

doKeyReleased

public boolean doKeyReleased(java.awt.event.KeyEvent aE)

doKeyTyped

public boolean doKeyTyped(java.awt.event.KeyEvent aE)

copyAlgorithmStructures

public void copyAlgorithmStructures(PaintAlgorithmThread aAlgorithm)


Fraid (system and language). (C) 2003-2007 Ivaylo Iliev
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.