ch.epfl.scapetoad
Class CartogramWizard

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by java.awt.Window
              extended by java.awt.Frame
                  extended by javax.swing.JFrame
                      extended by ch.epfl.scapetoad.CartogramWizard
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible, javax.swing.RootPaneContainer, javax.swing.WindowConstants

public class CartogramWizard
extends javax.swing.JFrame

The cartogram wizard guiding the user through the process of cartogram creation.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JFrame
javax.swing.JFrame.AccessibleJFrame
 
Nested classes/interfaces inherited from class java.awt.Frame
java.awt.Frame.AccessibleAWTFrame
 
Nested classes/interfaces inherited from class java.awt.Window
java.awt.Window.AccessibleAWTWindow
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
 
Fields inherited from class javax.swing.JFrame
accessibleContext, EXIT_ON_CLOSE, rootPane, rootPaneCheckingEnabled
 
Fields inherited from class java.awt.Frame
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
CartogramWizard()
          The default constructor for the wizard.
 
Method Summary
 boolean getAdvancedOptionsEnabled()
          Returns true if the advanced options for the cartogram computation are enabled.
 int getAmountOfDeformation()
          Returns the amount of deformation, an integer value between 0 (low deformation) and 100 (high deformation).
 javax.swing.JButton getCancelButton()
          Returns the cancel button of the cartogram wizard.
 Cartogram getCartogram()
          Returns the cartogram computation process.
 java.lang.String getCartogramAttributeName()
          Returns the cartogram attribute name.
 int getCartogramGridSizeInX()
          Returns the cartogram grid size in x direction.
 int getCartogramGridSizeInY()
          Returns the cartogram grid size in y direction.
 java.lang.String getCartogramLayerName()
          Returns the name of the selected cartogram layer.
 Layer getConstrainedDeformationLayerAtIndex(int index)
          Returns the constrained deformation layer at the given index.
 java.util.Vector getConstrainedDeformationLayers()
          Returns the list of constrained deformation layers.
 boolean getCreateGridLayer()
          Returns the parameter for the creation of a deformation grid layer.
 int getDeformationGridSize()
          Returns the size of the deformation grid which can be created as an additional layer.
 int getDiffusionGridSize()
           
 int getDiffusionIterations()
           
 java.lang.String getMissingValue()
           
 Layer getSimultaneousLayerAtIndex(int index)
          Returns the simultaneous layer at a given index.
 java.util.Vector getSimultaneousLayers()
          Returns the list of simultaneous layers.
 ch.epfl.scapetoad.WizardStepIconPanel getWizardStepIconPanel()
          Returns the wizard step icon panel.
 void goToFinishedPanel()
          Shows the finished panel.
 void goToStep(int step)
          Switches the wizard to the given step.
 void setAdvancedOptionsEnabled(boolean enabled)
          Defines whether the advances options should be taken into account.
 void setAmountOfDeformation(int deformation)
          Changes the amount of deformation.
 void setCartogram(Cartogram cg)
          Sets the cartogram computation process.
 void setCartogramAttributeName(java.lang.String attrName)
          Sets the cartogram attribute name.
 void setCartogramGridSizeInX(int gridSizeX)
          Changes the cartogram grid size in x direction.
 void setCartogramGridSizeInY(int gridSizeY)
          Changes the cartogram grid size in y direction.
 void setCartogramLayerName(java.lang.String layerName)
          Sets the cartogram layer name.
 void setComputationError(java.lang.String title, java.lang.String message, java.lang.String stackTrace)
          Sets a cartogram computation error message for the user.
 void setConstrainedDeformationLayerAtIndex(Layer layer, int index)
          Sets the constrained deformation layer at the given index.
 void setConstrainedDeformationLayers(java.util.Vector layers)
          Sets the list of constrained deformation layers.
 void setCreateGridLayer(boolean createGridLayer)
          Sets the parameter for the creation of a deformation grid layer.
 void setDeformationGridSize(int gridSize)
          Sets the size of the deformation grid which can be created as an additional layer.
 void setDiffusionGridSize(int diffusionGridSize)
           
 void setDiffusionIteratations(int iterations)
           
 void setMissingValue(java.lang.String value)
           
 void setSimultaneousLayerAtIndex(Layer layer, int index)
          Sets the simultaneous layer at a given index.
 void setSimultaneousLayers(java.util.Vector layers)
          Sets the list of simultaneous layers.
 void updateRunningStatus(int progress, java.lang.String label1, java.lang.String label2)
          Updates the progress bar and the progress labels during cartogram computation.
 
Methods inherited from class javax.swing.JFrame
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, update
 
Methods inherited from class java.awt.Frame
addNotify, finalize, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setResizable, setState, setTitle, setUndecorated
 
Methods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getMostRecentFocusOwner, getOwnedWindows, getOwner, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isShowing, pack, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, setAlwaysOnTop, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setLocationByPlatform, setLocationRelativeTo, show, toBack, toFront
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.awt.MenuContainer
getFont, postEvent
 

Constructor Detail

CartogramWizard

public CartogramWizard()
The default constructor for the wizard.

Method Detail

getWizardStepIconPanel

public ch.epfl.scapetoad.WizardStepIconPanel getWizardStepIconPanel()
Returns the wizard step icon panel.


goToStep

public void goToStep(int step)
Switches the wizard to the given step. The step number must be between 0 (introduction) and 3.


goToFinishedPanel

public void goToFinishedPanel()
Shows the finished panel.


getCartogram

public Cartogram getCartogram()
Returns the cartogram computation process.


setCartogram

public void setCartogram(Cartogram cg)
Sets the cartogram computation process.


getCartogramLayerName

public java.lang.String getCartogramLayerName()
Returns the name of the selected cartogram layer. This is the master layer for the cartogram transformation.


setCartogramLayerName

public void setCartogramLayerName(java.lang.String layerName)
Sets the cartogram layer name.


getCartogramAttributeName

public java.lang.String getCartogramAttributeName()
Returns the cartogram attribute name.


setCartogramAttributeName

public void setCartogramAttributeName(java.lang.String attrName)
Sets the cartogram attribute name.


getCreateGridLayer

public boolean getCreateGridLayer()
Returns the parameter for the creation of a deformation grid layer.

Returns:
whether we should create or not a deformation grid layer.

setCreateGridLayer

public void setCreateGridLayer(boolean createGridLayer)
Sets the parameter for the creation of a deformation grid layer.

Parameters:
createGridLayer - true if we should create a deformation grid layer, false otherwise.

getDeformationGridSize

public int getDeformationGridSize()
Returns the size of the deformation grid which can be created as an additional layer.

Returns:
the size of the deformation grid.

setDeformationGridSize

public void setDeformationGridSize(int gridSize)
Sets the size of the deformation grid which can be created as an additional layer. The effective grid size is adapted to the layer extent; this parameter sets the larger side of the layer extent rectangle.

Parameters:
gridSize - the size of the deformation grid.

updateRunningStatus

public void updateRunningStatus(int progress,
                                java.lang.String label1,
                                java.lang.String label2)
Updates the progress bar and the progress labels during cartogram computation.

Parameters:
progress - the progress status (integer 0-1000).
label1 - the progress main message.
label2 - the progress secondary message.

getSimultaneousLayers

public java.util.Vector getSimultaneousLayers()
Returns the list of simultaneous layers.


setSimultaneousLayers

public void setSimultaneousLayers(java.util.Vector layers)
Sets the list of simultaneous layers.


getSimultaneousLayerAtIndex

public Layer getSimultaneousLayerAtIndex(int index)
Returns the simultaneous layer at a given index.


setSimultaneousLayerAtIndex

public void setSimultaneousLayerAtIndex(Layer layer,
                                        int index)
Sets the simultaneous layer at a given index.


getConstrainedDeformationLayers

public java.util.Vector getConstrainedDeformationLayers()
Returns the list of constrained deformation layers.


setConstrainedDeformationLayers

public void setConstrainedDeformationLayers(java.util.Vector layers)
Sets the list of constrained deformation layers.


getConstrainedDeformationLayerAtIndex

public Layer getConstrainedDeformationLayerAtIndex(int index)
Returns the constrained deformation layer at the given index.


setConstrainedDeformationLayerAtIndex

public void setConstrainedDeformationLayerAtIndex(Layer layer,
                                                  int index)
Sets the constrained deformation layer at the given index.


getAmountOfDeformation

public int getAmountOfDeformation()
Returns the amount of deformation, an integer value between 0 (low deformation) and 100 (high deformation).


setAmountOfDeformation

public void setAmountOfDeformation(int deformation)
Changes the amount of deformation. This must be an integer value between 0 and 100.


getCartogramGridSizeInX

public int getCartogramGridSizeInX()
Returns the cartogram grid size in x direction. The cartogram grid is the grid which is deformed by the cartogram computing process. It is not the same grid as the one used by Gastner's algorithm. The cartogram grid can have an arbitrary size; it is only limited by the available amount of memory and disk space.


setCartogramGridSizeInX

public void setCartogramGridSizeInX(int gridSizeX)
Changes the cartogram grid size in x direction.


getCartogramGridSizeInY

public int getCartogramGridSizeInY()
Returns the cartogram grid size in y direction.


setCartogramGridSizeInY

public void setCartogramGridSizeInY(int gridSizeY)
Changes the cartogram grid size in y direction.


getAdvancedOptionsEnabled

public boolean getAdvancedOptionsEnabled()
Returns true if the advanced options for the cartogram computation are enabled.

Returns:
true if the advanced parameters should be taken in account, and false otherwise.

getDiffusionGridSize

public int getDiffusionGridSize()

setDiffusionGridSize

public void setDiffusionGridSize(int diffusionGridSize)

getDiffusionIterations

public int getDiffusionIterations()

setDiffusionIteratations

public void setDiffusionIteratations(int iterations)

setAdvancedOptionsEnabled

public void setAdvancedOptionsEnabled(boolean enabled)
Defines whether the advances options should be taken into account.

Parameters:
enabled - true if the advanced options should be taken into account, and false if the advanced options should be ignored.

setComputationError

public void setComputationError(java.lang.String title,
                                java.lang.String message,
                                java.lang.String stackTrace)
Sets a cartogram computation error message for the user.


getCancelButton

public javax.swing.JButton getCancelButton()
Returns the cancel button of the cartogram wizard.


getMissingValue

public java.lang.String getMissingValue()

setMissingValue

public void setMissingValue(java.lang.String value)