org.xistrat.gui.d3
Class RefreshDataGraph

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Canvas
          extended by javax.media.j3d.Canvas3D
              extended by org.xistrat.gui.d3.Board
                  extended by org.xistrat.gui.d3.CreateDataGraph
                      extended by org.xistrat.gui.d3.RefreshDataGraph
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible

public class RefreshDataGraph
extends CreateDataGraph

used to reset orientations and colors

Since:
0.5.42
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.awt.Canvas
java.awt.Canvas.AccessibleAWTCanvas
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
static java.lang.String faceInTable
           
 java.lang.String faceOutTable
           
static java.lang.String pointInTable
           
static java.lang.String pointOutTable
           
 
Fields inherited from class org.xistrat.gui.d3.CreateDataGraph
candidates, faceTable, inFile, neis_num, pointTable, propStr, realCandidates, scale, variant
 
Fields inherited from class org.xistrat.gui.d3.Board
_colors, _edge_colors, _vertices, _verts, colors, face, faceData, faces, helper, poly, polygons, size, vertices, verts
 
Fields inherited from class javax.media.j3d.Canvas3D
FIELD_ALL, FIELD_LEFT, FIELD_RIGHT
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
RefreshDataGraph(java.awt.GraphicsConfiguration gc, java.lang.String propStr, java.lang.String variant, int startNumColors, int maxNumTrials)
           
 
Method Summary
 javax.media.j3d.Group getGroup(javax.media.j3d.Canvas3D canvas)
           
 int greedy(int maxNumColors)
          works globally on faceData.color[] and resets colors greedily
 boolean resetColors()
          some quite simple 'naive coloring procedure' variant color all faces in a (deterministic or better) randomized way, then uncolor vertices in case they have neighbours with same color and finish with some greedy fillment
 void resetOrientations(boolean ok)
          according to the first face, give all faces the same orientation (that is the order in which the face's points are listed)
 GraphData setGraph(javax.vecmath.Point3f[] _verts, FaceData faceData)
          inverse to setVerts() , the nodes and edges could again be retrieved from the infile, just without setting the locations
 
Methods inherited from class org.xistrat.gui.d3.CreateDataGraph
findCandidates, findNeighbours, setFaceColors, setFaces, setVerts
 
Methods inherited from class org.xistrat.gui.d3.Board
addColorAndLight, areEqual, computeCenters, createBoard, createEdges, createEdges, createFacesShape, createMouseBehavior, createMouseBehavior, createPickSelectTargets, createSceneGraph, isNeighbourHood, notAlready, setColors
 
Methods inherited from class javax.media.j3d.Canvas3D
addNotify, getBounds, getBounds, getCenterEyeInImagePlate, getDoubleBufferAvailable, getDoubleBufferEnable, getGraphics2D, getGraphicsContext3D, getHeight, getImagePlateToVworld, getInverseVworldProjection, getLeftEyeInImagePlate, getLeftManualEyeInImagePlate, getLocation, getLocation, getLocationOnScreen, getMonoscopicViewPolicy, getOffScreenBuffer, getOffScreenLocation, getOffScreenLocation, getPhysicalHeight, getPhysicalWidth, getPixelLocationFromImagePlate, getPixelLocationInImagePlate, getPixelLocationInImagePlate, getRightEyeInImagePlate, getRightManualEyeInImagePlate, getSceneAntialiasingAvailable, getScreen3D, getSize, getSize, getStereoAvailable, getStereoEnable, getView, getVworldProjection, getVworldToImagePlate, getWidth, getX, getY, isOffScreen, isRendererRunning, isShadingLanguageSupported, paint, postRender, postSwap, preRender, queryProperties, removeNotify, renderField, renderOffScreenBuffer, setDoubleBufferEnable, setLeftManualEyeInImagePlate, setMonoscopicViewPolicy, setOffScreenBuffer, setOffScreenLocation, setOffScreenLocation, setRightManualEyeInImagePlate, setStereoEnable, startRenderer, stopRenderer, swap, waitForOffScreenRendering
 
Methods inherited from class java.awt.Canvas
createBufferStrategy, createBufferStrategy, getAccessibleContext, getBufferStrategy, update
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAlignmentX, getAlignmentY, getBackground, getColorModel, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getListeners, getLocale, getMaximumSize, getMinimumSize, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusCycleRoot, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, paramString, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, processComponentEvent, processEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setFont, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

pointInTable

public static final java.lang.String pointInTable
See Also:
Constant Field Values

faceInTable

public static final java.lang.String faceInTable
See Also:
Constant Field Values

pointOutTable

public static final java.lang.String pointOutTable
See Also:
Constant Field Values

faceOutTable

public java.lang.String faceOutTable
Constructor Detail

RefreshDataGraph

public RefreshDataGraph(java.awt.GraphicsConfiguration gc,
                        java.lang.String propStr,
                        java.lang.String variant,
                        int startNumColors,
                        int maxNumTrials)
Parameters:
startNumColors - the number of colors to start with (default is doing a greedy run to get a start value)
maxNumTrials - how often it is tried to find a solution with a given number of colors (the more it is tried, the smaller is the probability we miss an existing solution)
Method Detail

getGroup

public javax.media.j3d.Group getGroup(javax.media.j3d.Canvas3D canvas)
Overrides:
getGroup in class CreateDataGraph

setGraph

public GraphData setGraph(javax.vecmath.Point3f[] _verts,
                          FaceData faceData)
inverse to setVerts() , the nodes and edges could again be retrieved from the infile, just without setting the locations

See Also:
GraphFileInputParser.populateFromFile(java.lang.String)

resetColors

public boolean resetColors()
some quite simple 'naive coloring procedure' variant color all faces in a (deterministic or better) randomized way, then uncolor vertices in case they have neighbours with same color and finish with some greedy fillment

Returns:
if a desired coloring has been found or not

greedy

public int greedy(int maxNumColors)
works globally on faceData.color[] and resets colors greedily

Parameters:
maxNumColors - the number of colors allowed to use
Returns:
the number of colors used (maxNumColors + 1 if no solution has been found)

resetOrientations

public void resetOrientations(boolean ok)
according to the first face, give all faces the same orientation (that is the order in which the face's points are listed)

Parameters:
ok - if data should be stored into the database