cage.generator
Class SizeOption

java.lang.Object
  extended by cage.generator.SizeOption
All Implemented Interfaces:
java.awt.event.ActionListener, java.util.EventListener, javax.swing.event.ChangeListener

public class SizeOption
extends java.lang.Object
implements javax.swing.event.ChangeListener, java.awt.event.ActionListener

This class represents the single configuration for one face type or vertex type and is used in SizeOptionsMap.


Constructor Summary
SizeOption(int size, SizeOptionsMap m)
           
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
           
 void addTo(javax.swing.JPanel p)
           
 void addTo(javax.swing.JPanel p, boolean dual, boolean isLimitable)
           
 void deactivate()
           
 void focusToLimitControl()
          Tries to move the focus to the JCheckBox that disables and enables this vertex/face type.
 int getMax()
          Returns the upper bound set for these kind of faces/vertices.
 int getMin()
          Returns the lower bound set for these kind of faces/vertices.
 int getSize()
          Returns the size that is represented by this SizeOption.
 boolean isActive()
           
 boolean isLimited()
          Returns whether there are bounds imposed for the number of faces/vertices this option represents.
 void reactivate()
           
 void stateChanged(javax.swing.event.ChangeEvent e)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SizeOption

public SizeOption(int size,
                  SizeOptionsMap m)
Method Detail

addTo

public void addTo(javax.swing.JPanel p)

addTo

public void addTo(javax.swing.JPanel p,
                  boolean dual,
                  boolean isLimitable)

deactivate

public void deactivate()

reactivate

public void reactivate()

isActive

public boolean isActive()

getSize

public int getSize()
Returns the size that is represented by this SizeOption. This is either the degree of a vertex or the size of a face.

Returns:
the size that is represented by this SizeOption.

stateChanged

public void stateChanged(javax.swing.event.ChangeEvent e)
Specified by:
stateChanged in interface javax.swing.event.ChangeListener

actionPerformed

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

isLimited

public boolean isLimited()
Returns whether there are bounds imposed for the number of faces/vertices this option represents.

Returns:
true if there are bounds for the number of faces/vertices, false otherwise.

focusToLimitControl

public void focusToLimitControl()
Tries to move the focus to the JCheckBox that disables and enables this vertex/face type.


getMax

public int getMax()
Returns the upper bound set for these kind of faces/vertices.

Returns:
the upper bound set for these kind of faces/vertices

getMin

public int getMin()
Returns the lower bound set for these kind of faces/vertices.

Returns:
the lower bound set for these kind of faces/vertices