|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
java.awt.Window
java.awt.Frame
javax.swing.JFrame
jpview.gui.PTMFrame
public class PTMFrame
The PTMFrame is the container for the canvas. Also, it handles callbacks and fires transforms.
| Field Summary | |
|---|---|
int |
h
the height of the frame |
static java.lang.Object |
mutex
an object for synchronizing threads |
PTMCanvas |
ptmCanvas
the canvas displayed in the frame |
int |
w
the width of the frame |
| Fields inherited from class javax.swing.JFrame |
|---|
EXIT_ON_CLOSE |
| 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 | |
|---|---|
PTMFrame(java.lang.String name,
java.awt.Container c)
Creates a new PTMFrame instance |
|
| Method Summary | |
|---|---|
void |
actionPerformed(java.awt.event.ActionEvent e)
Handles callbacks for the right mouse menu |
void |
fireTransform()
exercises the current transform operator on the PTM data |
void |
forceUpdate()
force an update for the current tranform - decache and optimizations off |
PTMControls |
getControls()
Returns the controls for this frame |
int |
getExp()
delegate for PTM getExp() method |
FloatingControls |
getFloatingControls()
Returns the floating control panel used by the frame |
float |
getKDiff()
delegate for PTM getKDiff() |
float |
getKSpec()
delegate for the PTM getKSpec() |
float |
getLuminance()
Get the current value for the global ambient term |
PixelTransformOp |
getPixelTransformOp()
Returns the PixelTransformOp for this frame |
int |
getProgress()
Returns the amount of progress made reading the PTM (doesn't work over the internet) |
PTM |
getPTM()
Returns PTM object for this frame |
PTMCanvas |
getPTMCanvas()
Returns the canvas for this frame |
int |
getPTMHeight()
Returns the height of the current PTM |
int |
getPTMWidth()
Returns the width of the current PTM |
void |
handlePopup(java.awt.event.MouseEvent e)
used to handle right mouse menu display - this method consumes the event |
static void |
main(java.lang.String[] args)
Main method for testing |
void |
mouseClicked(java.awt.event.MouseEvent e)
Clicking the mouse diplays the right mouse menu on the canvas |
void |
mouseDragged(java.awt.event.MouseEvent e)
When the mouse is dragged, the position of the light moves with it |
void |
mouseEntered(java.awt.event.MouseEvent e)
not implemented |
void |
mouseExited(java.awt.event.MouseEvent e)
not implemented |
void |
mouseMoved(java.awt.event.MouseEvent e)
Not implemented (in a previous version, this updated the x-y coordinates in a status bar |
void |
mousePressed(java.awt.event.MouseEvent e)
used to handle right mouse display |
void |
mouseReleased(java.awt.event.MouseEvent e)
used to handle right mouse menu display |
int |
mouseX()
Returns the x value of the current mouse position |
int |
mouseY()
Returns the y value of the current mouse position |
void |
notImplemented()
Displays a simple dialog for unimplemented features - not used anymore! |
void |
refreshMap()
Reload the environment map |
void |
release()
Releases all the resources associated with this object |
void |
run()
This method is called by the thread that was created in the start method. |
void |
setBrowser(java.awt.Container c)
set the parent for this frame |
void |
setCanvas(PTMCanvas c)
Sets the PTM Canvas to use for this frame |
void |
setControls(PTMControls c)
Sets the PTMControls to use for this frame |
void |
setEnvironmentMap(EnvironmentMap e)
set the current environment map |
void |
setExp(int i)
Set the value of the exponent in the specular term of the Phong lighting equation for the specular transform operator |
void |
setKDiff(float f)
set the value of Kd in the Phong lighting equation for the specular tranform |
void |
setKSpec(float f)
Sets the KSpec term in the Phong lighting equation |
void |
setLuminance(float f)
Set the current value for the global ambient term |
void |
setMapBlurType(int i)
set the blur type for the map (SIMPLE,GAUSSIAN) |
void |
setMapGuassianBlurSigma(float f)
set the value of sigma for the gaussian blur procedure |
void |
setMapKernelSize(int i)
set the kernel size for the blur |
void |
setMapSampleSize(int i)
set the sample size for the environment map |
void |
setPixelTransformOp(PixelTransformOp pto)
sets the current transform operator to use when rendering a view |
void |
setPTM(PTM m)
Sets the PTM to use for this frame |
void |
start()
Starts the animation |
void |
stop()
Suspends the animation |
| Methods inherited from class javax.swing.JFrame |
|---|
getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isDefaultLookAndFeelDecorated, remove, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, update |
| Methods inherited from class java.awt.Frame |
|---|
addNotify, 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, 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, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusBackward, transferFocusDownCycle, validate |
| Methods inherited from class java.awt.Component |
|---|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, dispatchEvent, enable, enable, enableInputMethods, 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, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, 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 |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface jpview.gui.PTMWindow |
|---|
getHeight, getLayeredPane, getWidth |
| Methods inherited from interface java.awt.MenuContainer |
|---|
getFont, postEvent |
| Field Detail |
|---|
public int w
public int h
public PTMCanvas ptmCanvas
public static java.lang.Object mutex
| Constructor Detail |
|---|
public PTMFrame(java.lang.String name,
java.awt.Container c)
throws java.io.IOException,
java.lang.Exception
name - the name for the framec - the parent container
java.io.IOException - if PTM file can't be read
java.lang.Exception - if anything else goes wrong| Method Detail |
|---|
public void release()
public PTMControls getControls()
public PTM getPTM()
getPTM in interface PTMWindowpublic PTMCanvas getPTMCanvas()
public PixelTransformOp getPixelTransformOp()
public void setControls(PTMControls c)
setControls in interface PTMWindowc - the controlspublic void setPTM(PTM m)
m - the PTMpublic void setCanvas(PTMCanvas c)
c - the PTM Canvaspublic int mouseX()
public int mouseY()
public int getProgress()
public FloatingControls getFloatingControls()
public void mouseDragged(java.awt.event.MouseEvent e)
mouseDragged in interface java.awt.event.MouseMotionListenere - the mouse eventpublic void mouseMoved(java.awt.event.MouseEvent e)
mouseMoved in interface java.awt.event.MouseMotionListenere - the mouse eventpublic void setPixelTransformOp(PixelTransformOp pto)
setPixelTransformOp in interface PTMWindowpto - the transform operator to usepublic void start()
public void stop()
public void run()
run in interface java.lang.Runnablepublic void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed in interface java.awt.event.ActionListenere - the action eventpublic void mouseClicked(java.awt.event.MouseEvent e)
mouseClicked in interface java.awt.event.MouseListenere - the mouse eventpublic void mouseEntered(java.awt.event.MouseEvent e)
mouseEntered in interface java.awt.event.MouseListenere - the mouse eventpublic void mouseExited(java.awt.event.MouseEvent e)
mouseExited in interface java.awt.event.MouseListenere - the mouse eventpublic void mousePressed(java.awt.event.MouseEvent e)
mousePressed in interface java.awt.event.MouseListenere - the mouse eventpublic void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased in interface java.awt.event.MouseListenere - the mouse eventpublic void handlePopup(java.awt.event.MouseEvent e)
e - the mouse eventpublic void fireTransform()
fireTransform in interface PTMWindowpublic void notImplemented()
public static void main(java.lang.String[] args)
args - the command line argumentspublic int getExp()
getExp in interface PTMWindowpublic float getKDiff()
getKDiff in interface PTMWindowpublic float getKSpec()
getKSpec in interface PTMWindowpublic int getPTMHeight()
getPTMHeight in interface PTMWindowpublic int getPTMWidth()
getPTMWidth in interface PTMWindowpublic void setKSpec(float f)
setKSpec in interface PTMWindowf - the new valuepublic void setKDiff(float f)
setKDiff in interface PTMWindowf - the new value for Kdpublic void setExp(int i)
setExp in interface PTMWindowi - the new value for the exponentpublic float getLuminance()
getLuminance in interface PTMWindowpublic void setLuminance(float f)
setLuminance in interface PTMWindowf - the new valuepublic void refreshMap()
refreshMap in interface PTMWindowpublic void setMapSampleSize(int i)
setMapSampleSize in interface PTMWindowi - the sample sizepublic void setMapBlurType(int i)
setMapBlurType in interface PTMWindowi - the blur typepublic void setMapGuassianBlurSigma(float f)
setMapGuassianBlurSigma in interface PTMWindowf - sigmapublic void setMapKernelSize(int i)
setMapKernelSize in interface PTMWindowi - the kernel sizepublic void forceUpdate()
forceUpdate in interface PTMWindowpublic void setBrowser(java.awt.Container c)
setBrowser in interface PTMWindowc - the new parent containerpublic void setEnvironmentMap(EnvironmentMap e)
setEnvironmentMap in interface PTMWindowe - the environment map
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||