Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

junk.gui.window
Class JXWindow  view JXWindow download JXWindow.java

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjava.awt.Window
              extended byjavax.swing.JWindow
                  extended byjunk.gui.window.JXWindow
All Implemented Interfaces:
javax.accessibility.Accessible, java.util.EventListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, javax.swing.RootPaneContainer, java.io.Serializable

public class JXWindow
extends javax.swing.JWindow
implements java.awt.event.MouseListener, java.awt.event.MouseMotionListener

JXWindow is a window with a custom drawn border and custom mouse handling behaviour. All custom components using it must define an empty border that do not overlap the custom drawn borders so that the custom border will retain its design. The client defined empty border should be a width of 5 or more if the client has altered the design. The design decision to include this custom heavy weight is so that some GUI can be platform independent such that porting it is easy and its behaviour can remain consistant in varying systems. One such example is the GUI of the JXController, which needs to exist even if the JD4X windowing module fails or has not yet been initialized.
This window should only be used if its designed advantage out weigths the disadvantage of having a non-conforming GUI that must always be custom crafted from the rest. In addition, the window might not be able to handle focus and keyboard input well.

Since:
JD4X 1.0
Version:
0.1, 15/04/2003

Nested Class Summary
 
Nested classes inherited from class javax.swing.JWindow
javax.swing.JWindow.AccessibleJWindow
 
Nested classes inherited from class java.awt.Window
java.awt.Window.AccessibleAWTWindow
 
Nested classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
protected  java.awt.Image jbar_h
          Texture to be used for the box
protected  java.awt.Image jbar_v
          Texture to be used for the box
protected  java.awt.Image jcorner_b_lt
          Texture to be used for the box
protected  java.awt.Image jcorner_b_rt
          Texture to be used for the box
protected  java.awt.Image jcorner_t_lt
          Texture to be used for the box
protected  java.awt.Image jcorner_t_rt
          Texture to be used for the box
private  boolean mouseCenterPressed
          Mouse function bits for determining mouse action
private  boolean mouseDrag
          Mouse function bits for determining mouse action
private  boolean mouseLeftPressed
          Mouse function bits for determining mouse action
private  boolean mouseRightPressed
          Mouse function bits for determining mouse action
private  int oldvalueX
          Locations of the GUI on screen
private  int oldvalueY
          Locations of the GUI on screen
protected  int POLL
          Controller of the window movement speed
private  int polling
          Calculations used for the mouse functions
private  int sumx
          Calculations used for the mouse functions
private  int sumy
          Calculations used for the mouse functions
private  int valueX
          Locations of the GUI on screen
private  int valueY
          Locations of the GUI on screen
 
Fields inherited from class javax.swing.JWindow
accessibleContext, rootPane, rootPaneCheckingEnabled
 
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 java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
JXWindow()
           
 
Method Summary
 void mouseClicked(java.awt.event.MouseEvent clickEvent)
          1 click = frame focus and move to front.
 void mouseDragged(java.awt.event.MouseEvent draggedEvent)
          Move box following mouse position.
 void mouseEntered(java.awt.event.MouseEvent enterEvent)
          Does nothing.
 void mouseExited(java.awt.event.MouseEvent exitEvent)
          Does nothing.
 void mouseMoved(java.awt.event.MouseEvent movedEvent)
          Update mouse position.
 void mousePressed(java.awt.event.MouseEvent pressEvent)
          Update mouse button pressed.
 void mouseReleased(java.awt.event.MouseEvent releaseEvent)
          Update mouse button released.
 void paint(java.awt.Graphics g)
          Clients can extend this method to customize their box texture.
 void updateTheme()
          Set the default icon and color theme of the window.
 
Methods inherited from class javax.swing.JWindow
addImpl, createRootPane, getAccessibleContext, getContentPane, getGlassPane, getLayeredPane, getPreferredSize, getRootPane, isRootPaneCheckingEnabled, paramString, processKeyEvent, remove, setContentPane, setGlassPane, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, update, windowInit
 
Methods inherited from class java.awt.Window
addNotify, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getGraphicsConfiguration, getListeners, getLocale, getMostRecentFocusOwner, getOwnedWindows, getOwner, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindowStateListeners, hide, isActive, isFocusableWindow, isFocusCycleRoot, isFocused, isShowing, pack, postEvent, processEvent, processWindowEvent, 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, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, removeNotify, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFont, 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, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, 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, 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, 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, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

polling

private int polling
Calculations used for the mouse functions


sumx

private int sumx
Calculations used for the mouse functions


sumy

private int sumy
Calculations used for the mouse functions


valueX

private int valueX
Locations of the GUI on screen


valueY

private int valueY
Locations of the GUI on screen


oldvalueX

private int oldvalueX
Locations of the GUI on screen


oldvalueY

private int oldvalueY
Locations of the GUI on screen


mouseDrag

private boolean mouseDrag
Mouse function bits for determining mouse action


mouseLeftPressed

private boolean mouseLeftPressed
Mouse function bits for determining mouse action


mouseRightPressed

private boolean mouseRightPressed
Mouse function bits for determining mouse action


mouseCenterPressed

private boolean mouseCenterPressed
Mouse function bits for determining mouse action


POLL

protected int POLL
Controller of the window movement speed


jcorner_t_lt

protected java.awt.Image jcorner_t_lt
Texture to be used for the box


jcorner_t_rt

protected java.awt.Image jcorner_t_rt
Texture to be used for the box


jcorner_b_lt

protected java.awt.Image jcorner_b_lt
Texture to be used for the box


jcorner_b_rt

protected java.awt.Image jcorner_b_rt
Texture to be used for the box


jbar_h

protected java.awt.Image jbar_h
Texture to be used for the box


jbar_v

protected java.awt.Image jbar_v
Texture to be used for the box

Constructor Detail

JXWindow

public JXWindow()
Method Detail

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent clickEvent)
1 click = frame focus and move to front.

Specified by:
mouseClicked in interface java.awt.event.MouseListener

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent enterEvent)
Does nothing.

Specified by:
mouseEntered in interface java.awt.event.MouseListener

mouseExited

public void mouseExited(java.awt.event.MouseEvent exitEvent)
Does nothing.

Specified by:
mouseExited in interface java.awt.event.MouseListener

mouseDragged

public void mouseDragged(java.awt.event.MouseEvent draggedEvent)
Move box following mouse position. (solid move)

Specified by:
mouseDragged in interface java.awt.event.MouseMotionListener

mouseMoved

public void mouseMoved(java.awt.event.MouseEvent movedEvent)
Update mouse position.

Specified by:
mouseMoved in interface java.awt.event.MouseMotionListener

mousePressed

public void mousePressed(java.awt.event.MouseEvent pressEvent)
Update mouse button pressed.

Specified by:
mousePressed in interface java.awt.event.MouseListener

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent releaseEvent)
Update mouse button released.

Specified by:
mouseReleased in interface java.awt.event.MouseListener

paint

public void paint(java.awt.Graphics g)
Clients can extend this method to customize their box texture.


updateTheme

public void updateTheme()
Set the default icon and color theme of the window.