|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object
|
+--java.awt.Component
|
+--java.awt.Container
|
+--java.awt.Window
|
+--java.awt.Frame
|
+--javax.swing.JFrame
|
+--Renderer.Playground
Defines the graphical equivalent of a "universe" full of "worlds." It is a collection of Sandbox containers, each with its own three-dimensional, interactive view of its "objects" (Toys). This is the top-level user interface that allows all aspects of the system to be viewed, manipulated, etc.
A Playground contains any number of Sandboxes. Each depicts a slightly different interpretation of the source-text description. They can be viewed independently or synchronized.
Sandbox,
Serialized Form| Nested Class Summary | |
private class |
Playground.SandboxFrame
|
| Field Summary | |
private float |
CLUSTERED_COMPOSITE_OBJECT_TRANSPARENCY
|
static java.lang.String |
COLORMAP_FILENAME
|
static java.lang.String |
HOME_PATH
|
static java.lang.String |
INSTALL_PATH
|
protected static int |
INSTANTIATION_KEY
|
private java.util.Hashtable |
m_color_map
|
private javax.swing.JDesktopPane |
m_desktop
|
private int |
m_frame_height
|
private int |
m_frame_height_prev
|
private int |
m_frame_location_x_prev
|
private int |
m_frame_location_y_prev
|
private int |
m_frame_width
|
private int |
m_frame_width_prev
|
private boolean |
m_is_wireframe
|
private ModelLibrary |
m_model_library
|
private java.util.LinkedList |
m_monte_carlo_run_sets
|
private java.lang.String |
m_name
|
private java.util.HashMap |
m_open_representation_viewers
|
private java.util.LinkedHashMap |
m_sandbox_frames
|
private java.util.Hashtable |
m_sandboxes
|
static java.lang.String |
MODEL_PATH
|
private java.awt.Color |
PLAYGROUND_WINDOW_BACKGROUND_COLOR
|
private java.awt.Color |
SANDBOX_WINDOW_BACKGROUND_COLOR
|
private int |
SCREEN_HEIGHT
|
private int |
SCREEN_WIDTH
|
static java.lang.String |
TEMP_PATH
|
private int |
WINDOW_BASE_X
|
private int |
WINDOW_BASE_Y
|
private int |
WINDOW_CASCADE_SPACING_X
|
private int |
WINDOW_CASCADE_SPACING_Y
|
private int |
WINDOW_PLACEMENT_CASCADE
|
private int |
WINDOW_PLACEMENT_RELOCATE
|
private int |
WINDOW_PLACEMENT_TILE
|
private int |
WINDOW_PLACEMENT_TO_FRONT
|
private int |
WINDOW_TILE_SPACING_X
|
private int |
WINDOW_TILE_SPACING_Y
|
| 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.Window |
|
| Fields inherited from class java.awt.Container |
|
| 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 | |
Playground(java.lang.String name,
java.util.LinkedList monte_carlo_run_sets,
boolean is_wireframe,
int frame_width,
int frame_height)
Creates a new playground from the the MonteCarloRunSets created in the Reasoner and refined in the Distiller. |
|
| Method Summary | |
void |
addColorMapEntry(java.lang.String region_name,
javax.vecmath.Color3f color)
Adds a palette entry for the colors of a named region. |
Sandbox |
createSandbox(java.lang.String sandbox_name,
MonteCarloRunSet monte_carlo_run_set)
Creates and adds a new sandbox. |
void |
depict(boolean show_clustering,
boolean show_toy_geometry,
boolean show_toy_topology)
Builds the playground based on its contents at the time of this call. |
private void |
depict(java.lang.String monte_carlo_run_set_source_name,
java.lang.String monte_carlo_run_set_mirror_name,
boolean show_clustering,
boolean show_toy_geometry,
boolean show_toy_topology)
Builds the playground based on its contents at the time of this call. |
private javax.vecmath.Color3f |
getClusterColor(int clusterID)
Returns a color associated with a cluster. |
private MonteCarloRunSet |
getMonteCarloRunSet(java.lang.String run_set_name)
Returns the Monte Carlo run set associated with a sandbox. |
java.lang.String |
getName()
Returns the name of this playground. |
private javax.vecmath.Color3f |
getRegionColor(java.lang.String region_name)
Returns the color stored in the palette for a region. |
Sandbox |
getSandbox(java.lang.String sandbox_name)
Returns a sandbox. |
int |
getSandboxCount()
Returns the number of sandboxes in this playground. |
java.util.Enumeration |
getSandboxNames()
Returns the names of sandboxes in this playground. |
private void |
initializeColorMap()
Initialize a palette with default colors from the colormap file for standard named regions. |
void |
mirrorSandbox(java.lang.String source_sandbox_name,
java.lang.String mirror_sandbox_name,
boolean show_clustering,
boolean show_toy_geometry,
boolean show_toy_topology)
Creates a clone of a sandbox in its own window. |
void |
paint(java.awt.Graphics graphics)
Catches the repaint event, which is the only known way to detect when the playground container has been resized. |
private void |
placeWindows(int mode)
Places the sandbox windows according to the mode specified. |
private void |
placeWindows(int mode,
int offset_x,
int offset_y)
Places the sandbox windows according to the mode and location specified. |
protected void |
processSandboxCallback(Sandbox sandbox,
java.lang.String selection_identifier,
java.awt.event.MouseEvent event)
Handles a selection callback from the SandboxController in charge of one of the sandboxes and open a representation viewer for the selected toy. |
private void |
refresh()
Redisplays the emulated MDI contents. |
protected void |
releaseRepresentationViewer(java.lang.String viewer_name)
Releases a representation viewer from the in-use list upon its close. |
void |
synchronizeSandboxes(Sandbox master_sandbox)
Forces all sandboxes to update based on the viewer properties of the given one. |
java.lang.String |
toString()
Returns a string representation of this object. |
| 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, 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, setIconImage, 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, isFocusableWindow, isFocusCycleRoot, isFocused, isShowing, pack, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, setCursor, setFocusableWindowState, setFocusCycleRoot, 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, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setFocusTraversalKeys, setFocusTraversalPolicy, 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, 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, getMouseWheelListeners, 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, isOpaque, 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, setBounds, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, size, 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 |
| Field Detail |
protected static final int INSTANTIATION_KEY
public static final java.lang.String INSTALL_PATH
public static final java.lang.String HOME_PATH
public static final java.lang.String TEMP_PATH
public static final java.lang.String MODEL_PATH
public static final java.lang.String COLORMAP_FILENAME
private final float CLUSTERED_COMPOSITE_OBJECT_TRANSPARENCY
private ModelLibrary m_model_library
private java.util.Hashtable m_sandboxes
private java.util.LinkedList m_monte_carlo_run_sets
private java.lang.String m_name
private boolean m_is_wireframe
private java.util.Hashtable m_color_map
private final java.awt.Color SANDBOX_WINDOW_BACKGROUND_COLOR
private final java.awt.Color PLAYGROUND_WINDOW_BACKGROUND_COLOR
private int SCREEN_WIDTH
private int SCREEN_HEIGHT
private final int WINDOW_BASE_X
private final int WINDOW_BASE_Y
private int WINDOW_CASCADE_SPACING_X
private int WINDOW_CASCADE_SPACING_Y
private int WINDOW_TILE_SPACING_X
private int WINDOW_TILE_SPACING_Y
private final int WINDOW_PLACEMENT_TILE
private final int WINDOW_PLACEMENT_CASCADE
private final int WINDOW_PLACEMENT_TO_FRONT
private final int WINDOW_PLACEMENT_RELOCATE
private javax.swing.JDesktopPane m_desktop
private java.util.LinkedHashMap m_sandbox_frames
private int m_frame_width
private int m_frame_height
private int m_frame_width_prev
private int m_frame_height_prev
private int m_frame_location_x_prev
private int m_frame_location_y_prev
private java.util.HashMap m_open_representation_viewers
| Constructor Detail |
public Playground(java.lang.String name,
java.util.LinkedList monte_carlo_run_sets,
boolean is_wireframe,
int frame_width,
int frame_height)
throws java.lang.Exception
name - - the arbitrary name of this playgroundmonte_carlo_run_sets - - the Monte Carlo run sets providing the source datais_wireframe - - whether everything is this playground should be rendered in wireframeframe_width - - the width of each sandbox windowframe_height - - the height of each sandbox window
java.lang.Exception - - if the playground cannot be created| Method Detail |
public void addColorMapEntry(java.lang.String region_name,
javax.vecmath.Color3f color)
Regions that have neither a built-in color or nor an entry that has been added here will be displayed with a default color.
region_name - - the name of the regioncolor - - the color to associate with the regioninitializeColorMap(),
getRegionColor(java.lang.String)
public Sandbox createSandbox(java.lang.String sandbox_name,
MonteCarloRunSet monte_carlo_run_set)
throws java.lang.Exception
sandbox_name - - the sandbox namemonte_carlo_run_set - - the Monte Carlo run set defining the contents of the sandbox to create
java.lang.Exception - - if a sandbox with the given name is already present in the playground
public void depict(boolean show_clustering,
boolean show_toy_geometry,
boolean show_toy_topology)
throws java.lang.Exception
show_clustering - - whether clustering is indicated through colors that override the model colorsshow_toy_geometry - - whether the region geometry meshes of each toy should be displayedshow_toy_topology - - whether the region topology meshes should be displayed with the geometry, if it is shown
java.lang.Exception - - if the depiction fails; a duplicate-sandbox exception results if this is called twice
private void depict(java.lang.String monte_carlo_run_set_source_name,
java.lang.String monte_carlo_run_set_mirror_name,
boolean show_clustering,
boolean show_toy_geometry,
boolean show_toy_topology)
throws java.lang.Exception
monte_carlo_run_set_source_name - - the name of the sandbox to mirror, or nullmonte_carlo_run_set_mirror_name - - the name to assign to the clone, or nullshow_clustering - - whether clustering is indicated through colors that override the model colorsshow_toy_geometry - - whether the region geometry meshes of each toy should be displayedshow_toy_topology - - whether the region topology meshes should be displayed with the geometry, if it is shown
The only valid combination of parameters is two strings or two nulls.
java.lang.Exception - - if an attempt is made to mirror the mirror of sandboxprivate javax.vecmath.Color3f getClusterColor(int clusterID)
clusterID - - the cluster ID
private MonteCarloRunSet getMonteCarloRunSet(java.lang.String run_set_name)
run_set_name - - the run-set name, which is the same as the sandbox name
java.lang.Exception - - if the run set does not existpublic java.lang.String getName()
getName in class java.awt.Componentprivate javax.vecmath.Color3f getRegionColor(java.lang.String region_name)
Side Effect: writes a warning to stderr if the given region has no palette entry.
region_name - - the region name
addColorMapEntry(java.lang.String, javax.vecmath.Color3f),
initializeColorMap(),
Support.writeWarning(java.lang.String, java.lang.String)public Sandbox getSandbox(java.lang.String sandbox_name)
sandbox_name - - the sandbox name
public int getSandboxCount()
public java.util.Enumeration getSandboxNames()
private void initializeColorMap()
throws java.lang.Exception
This can be recoded for more attractive results and to reflect new standard region names.
java.lang.Exception - - if the color-map file cannot be loadedaddColorMapEntry(java.lang.String, javax.vecmath.Color3f),
getRegionColor(java.lang.String)
public void mirrorSandbox(java.lang.String source_sandbox_name,
java.lang.String mirror_sandbox_name,
boolean show_clustering,
boolean show_toy_geometry,
boolean show_toy_topology)
throws java.lang.Exception
source_sandbox_name - - the name of the sandbox to clonemirror_sandbox_name - - the name to assign to the cloneshow_clustering - - whether clustering is indicated through colors that override the model colorsshow_toy_geometry - - whether the region geometry meshes of each toy should be displayedshow_toy_topology - - whether the region topology meshes should be displayed with the geometry, if it is shown
java.lang.Exception - - if the sandbox to clone is not presentpublic void paint(java.awt.Graphics graphics)
paint in class java.awt.Containergraphics - - the graphics context of the paint eventprivate void placeWindows(int mode)
mode - - the modeWINDOW_PLACEMENT_TILE,
WINDOW_PLACEMENT_CASCADE,
WINDOW_PLACEMENT_RELOCATE,
WINDOW_PLACEMENT_TO_FRONT
private void placeWindows(int mode,
int offset_x,
int offset_y)
mode - - the modeoffset_x - - the left starting point of the placementoffset_y - - the top starting point of the placementWINDOW_PLACEMENT_TILE,
WINDOW_PLACEMENT_CASCADE,
WINDOW_PLACEMENT_RELOCATE,
WINDOW_PLACEMENT_TO_FRONT
protected void processSandboxCallback(Sandbox sandbox,
java.lang.String selection_identifier,
java.awt.event.MouseEvent event)
sandbox - - the sandbox originating the callbackselection_identifier - - an identifier specifying what was clicked onevent - - the event that invoked this callbackRepresentationViewerprivate void refresh()
protected void releaseRepresentationViewer(java.lang.String viewer_name)
This is called by RepresentationViewer.
viewer_name - - the viewer nameRepresentationViewerpublic void synchronizeSandboxes(Sandbox master_sandbox)
master_sandbox - - the master sandboxpublic java.lang.String toString()
toString in class java.awt.ComponentSupport.toPrettyString(java.lang.String)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||