|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.xith3d.ui.hud.base.Widget
org.xith3d.ui.hud.base.Window
public abstract class Window
This class represents a simple Window above the HUD.
| Nested Class Summary | |
|---|---|
static class |
Window.CloseOperation
This enum can be used for the setCloseOperation() method of a Window. |
| Nested classes/interfaces inherited from class org.xith3d.ui.hud.base.Widget |
|---|
Widget.DescriptionBase |
| Field Summary |
|---|
| Fields inherited from class org.xith3d.ui.hud.base.Widget |
|---|
transformHeight_Pixels2HUD, transformWidth_Pixels2HUD |
| Constructor Summary | |
|---|---|
protected |
Window(float width,
float height,
boolean keepContentPaneSize,
WidgetContainer contentPane,
WindowHeaderWidget.Description headerDesc,
java.lang.String title)
Creates a new Window. |
protected |
Window(float width,
float height,
boolean keepContentPaneSize,
WidgetContainer contentPane,
WindowHeaderWidget headerWidget)
Creates a new Window. |
|
Window(WidgetContainer contentPane)
Creates a new undecorated Window. |
|
Window(WidgetContainer contentPane,
java.lang.String title)
Creates a new Window. |
|
Window(WidgetContainer contentPane,
WindowHeaderWidget.Description headerDesc,
java.lang.String title)
Creates a new Window. |
|
Window(WidgetContainer contentPane,
WindowHeaderWidget headerWidget)
Creates a new Window. |
| Method Summary | |
|---|---|
void |
addWindowListener(WindowListener l)
Adds a new WindowListener. |
protected boolean |
checkDragStartCondition(float postionOnWindowX,
float postionOnWindowY)
|
protected abstract WidgetContainer |
createContentPane(float width,
float height)
|
protected abstract WindowHeaderWidget |
createHeaderWidget(WindowHeaderWidget.Description headerDesc,
java.lang.String title)
Creates the header Widget for this decorated Window. |
void |
detach()
Removes the Widget from its Container. |
void |
drawAndUpdateWidget(Texture2DCanvas texCanvas,
int offsetX,
int offsetY,
int width,
int height,
boolean drawsSelf)
|
protected void |
drawBorder(Border border,
Texture2DCanvas texCanvas,
int offsetX,
int offsetY,
int width,
int height)
|
protected void |
drawWidget(Texture2DCanvas texCanvas,
int offsetX,
int offsetY,
int width,
int height,
boolean drawsSelf)
|
protected int |
getContentHeightPX()
Gets the height of the widget's content area (minus border and padding) (in pixels). |
WidgetContainer |
getContentPane()
|
protected int |
getContentWidthPX()
Gets the width of the widget's content area (minus border and padding) (in pixels). |
Window.CloseOperation |
getDefaultCloseOperation()
|
float |
getHeaderHeight()
Gets the height of the title-bar. |
protected WindowHeaderWidget |
getHeaderWidget()
|
float |
getResX()
|
float |
getResY()
|
java.lang.String |
getTitle()
Gets the Window's title. |
protected void |
init()
This method is called when the WidgetContainer is set. |
boolean |
isCloseButtonVisible()
|
boolean |
isDecorated()
|
boolean |
isPaneDraggingEnabled()
|
protected void |
onCloseButtonClicked()
This event is fired, if the close button on the Header-Widget was clicked. |
protected void |
onDetachedFromHUD(HUD hud)
This event is fired, when this Widget is removed from the HUD live Widget hierarchy. |
protected void |
onFocusLost()
This event is fired, when the focus is lost by a Widget. |
protected void |
onKeyPressed(org.jagatoo.input.devices.components.Key key,
int modifierMask,
long when)
This event is fired, when a key is pressed on a focused Widget. |
protected void |
onKeyReleased(org.jagatoo.input.devices.components.Key key,
int modifierMask,
long when)
This event is fired, when a key is released on a focused Widget. |
protected void |
onKeyTyped(char ch,
int modifierMask,
long when)
This event is fired when a key is typed on the keyboard. |
protected void |
onMouseButtonPressed(org.jagatoo.input.devices.components.MouseButton button,
float x,
float y,
long when,
long lastWhen,
boolean isTopMost,
boolean hasFocus)
This event is fired, when a mouse button is pressed on a focused Widget. |
protected void |
onMouseButtonReleased(org.jagatoo.input.devices.components.MouseButton button,
float x,
float y,
long when,
long lastWhen,
boolean isTopMost,
boolean hasFocus)
This event is fired, when a mouse button is released on a focused Widget. |
protected void |
onMouseExited(boolean isTopMost,
boolean hasFocus)
This method is called when the mouse exited the Widget area. |
protected void |
onMouseMoved(float x,
float y,
int buttonsState,
long when,
boolean isTopMost,
boolean hasFocus)
This event is fired, when the mouse is moved on a Widget. |
protected void |
onMouseWheelMoved(int delta,
boolean isPageMove,
float x,
float y,
long when,
boolean isTopMost)
This event is fired, when the mouse wheel is moved on a Widget. |
protected void |
onSizeChanged(float oldWidth,
float oldHeight,
float newWidth,
float newHeight)
|
protected void |
onVisibilityChanged(boolean visible)
This method is triggered when the visibility state has eeffectively changed. |
protected HUDPickResult |
pick(int canvasX,
int canvasY,
HUDPickResult.HUDPickReason pickReason,
org.jagatoo.input.devices.components.MouseButton button,
long when,
long meta,
int flags)
Tests whether a Widget is under the cursor and runs the approriate methods if true. |
void |
removeWindowListener(WindowListener l)
Removes a WindowListener. |
void |
setCloseButtonVisible(boolean visible)
Sets the close button visible of hidden. |
void |
setContentSize(float contentWidth,
float contentHeight)
Sets the size of the window, so that the content-pane is the given size. |
void |
setDefaultCloseOperation(Window.CloseOperation op)
Sets the default (if not overridden) CloseOperation to be executed when the close Button was clicked. |
protected void |
setHostTextureDirty(int flags)
|
void |
setPaneDraggingEnabled(boolean enabled)
Sets pane-dragging enabled or disabled. |
protected void |
setTextureDirty(int flags)
|
void |
setTitle(java.lang.String title)
Sets the Window's title. |
protected void |
startDragging(int canvasX,
int canvasY,
float widgetX,
float widgetY)
|
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
protected Window(float width,
float height,
boolean keepContentPaneSize,
WidgetContainer contentPane,
WindowHeaderWidget.Description headerDesc,
java.lang.String title)
width - the width of the Windowheight - the height of the WindowkeepContentPaneSize - contentPane - the Widget that visually defines the Window.headerDesc - the description of this Window's header (or null for an undecorated Window)title - this Window's title
protected Window(float width,
float height,
boolean keepContentPaneSize,
WidgetContainer contentPane,
WindowHeaderWidget headerWidget)
width - the width of the Windowheight - the height of the WindowkeepContentPaneSize - contentPane - the Widget that visually defines the Window.headerWidget - a Widget, that defines this Window's header (or null for an undecorated Window)
public Window(WidgetContainer contentPane,
WindowHeaderWidget.Description headerDesc,
java.lang.String title)
contentPane - the Widget that visually defines the Window.headerDesc - the description of this Window's header (or null for an undecorated Window)title - this Window's title
public Window(WidgetContainer contentPane,
WindowHeaderWidget headerWidget)
contentPane - the Widget that visually defines the Window.headerWidget - a Widget, that defines this Window's header (or null for an undecorated Window)
public Window(WidgetContainer contentPane,
java.lang.String title)
contentPane - the Widget that visually defines the Window.title - this Window's header (or null for an undecorated Window)public Window(WidgetContainer contentPane)
contentPane - the Widget that visually defines the Window.| Method Detail |
|---|
protected final WindowHeaderWidget getHeaderWidget()
public final boolean isDecorated()
public float getHeaderHeight()
public void setTitle(java.lang.String title)
title - public final java.lang.String getTitle()
public final WidgetContainer getContentPane()
protected final int getContentWidthPX()
Widget
getContentWidthPX in class Widgetprotected final int getContentHeightPX()
Widget
getContentHeightPX in class Widget
public void setContentSize(float contentWidth,
float contentHeight)
contentWidth - contentHeight - public final float getResX()
public final float getResY()
public void setDefaultCloseOperation(Window.CloseOperation op)
op - the default close operation or null for no operationpublic final Window.CloseOperation getDefaultCloseOperation()
public void setCloseButtonVisible(boolean visible)
visible -
java.lang.UnsupportedOperationException - if this is an undecorated Windowpublic boolean isCloseButtonVisible()
java.lang.UnsupportedOperationException - if this is an undecorated Windowpublic void setPaneDraggingEnabled(boolean enabled)
public final boolean isPaneDraggingEnabled()
protected boolean checkDragStartCondition(float postionOnWindowX,
float postionOnWindowY)
protected void startDragging(int canvasX,
int canvasY,
float widgetX,
float widgetY)
startDragging in class Widget
protected void onMouseButtonPressed(org.jagatoo.input.devices.components.MouseButton button,
float x,
float y,
long when,
long lastWhen,
boolean isTopMost,
boolean hasFocus)
onMouseButtonPressed in class Widgetbutton - the button that was pressedx - the current mouse x positiony - the current mouse y positionisTopMost - is this Widget topMosthasFocus - is this Widget focusednet.jtank.input.MouseCode
protected void onMouseButtonReleased(org.jagatoo.input.devices.components.MouseButton button,
float x,
float y,
long when,
long lastWhen,
boolean isTopMost,
boolean hasFocus)
onMouseButtonReleased in class Widgetbutton - the button that was releasedx - the current mouse x positiony - the current mouse y positionisTopMost - is this Widget topMosthasFocus - is this Widget focusednet.jtank.input.MouseCode
protected void onMouseMoved(float x,
float y,
int buttonsState,
long when,
boolean isTopMost,
boolean hasFocus)
onMouseMoved in class Widgetx - the new X coordinatey - the new Y coordinateisTopMost - is this Widget topMosthasFocus - is this Widget focused
protected void onMouseWheelMoved(int delta,
boolean isPageMove,
float x,
float y,
long when,
boolean isTopMost)
onMouseWheelMoved in class Widgetdelta - a positive value when the wheel was moved upx - the current mouse x positiony - the current mouse y positionisTopMost - is this Widget topMostprotected void onFocusLost()
onFocusLost in class Widget
protected void onMouseExited(boolean isTopMost,
boolean hasFocus)
onMouseExited in class WidgetisTopMost - is this Widget topMosthasFocus - is this Widget focused
protected void onKeyPressed(org.jagatoo.input.devices.components.Key key,
int modifierMask,
long when)
onKeyPressed in class Widgetkey - the key that was pressedmodifierMask - the mask of modifier keyswhen - the keyevent's timestamp
protected void onKeyReleased(org.jagatoo.input.devices.components.Key key,
int modifierMask,
long when)
onKeyReleased in class Widgetkey - the key that was releasedmodifierMask - the mask of modifier keyswhen - the keyevent's timestamp
protected void onKeyTyped(char ch,
int modifierMask,
long when)
onKeyTyped in class Widgetch - the typed key's charactermodifierMask - the mask of modifier keyswhen - the keyevent's timestamppublic void addWindowListener(WindowListener l)
l - the new WindowListenerpublic void removeWindowListener(WindowListener l)
l - the WindowListener to removepublic void detach()
detach in class Widgetprotected void onCloseButtonClicked()
detach()protected void onVisibilityChanged(boolean visible)
onVisibilityChanged in class Widget
protected void onSizeChanged(float oldWidth,
float oldHeight,
float newWidth,
float newHeight)
onSizeChanged in class Widget
protected HUDPickResult pick(int canvasX,
int canvasY,
HUDPickResult.HUDPickReason pickReason,
org.jagatoo.input.devices.components.MouseButton button,
long when,
long meta,
int flags)
pick in class WidgetcanvasX - the x position of the mouse on the Canvas3DcanvasY - the y position of the mouse on the Canvas3DpickReason - the action which caused this pick operationbutton - the mouse-button, that caused the pickingwhen - the timestamp of the pickingmeta - this could be either the lastPressTime, lastReleaseTime, buttonsState mask or the page-move-boolean. (depends on the pickReason)
protected void onDetachedFromHUD(HUD hud)
onDetachedFromHUD in class Widgethud - the HUD, the Widget is removed frompublic java.lang.String toString()
toString in class Widgetprotected void setHostTextureDirty(int flags)
setHostTextureDirty in class Widgetprotected void setTextureDirty(int flags)
setTextureDirty in class Widget
protected void drawBorder(Border border,
Texture2DCanvas texCanvas,
int offsetX,
int offsetY,
int width,
int height)
drawBorder in class Widget
protected void drawWidget(Texture2DCanvas texCanvas,
int offsetX,
int offsetY,
int width,
int height,
boolean drawsSelf)
drawWidget in class Widget
public void drawAndUpdateWidget(Texture2DCanvas texCanvas,
int offsetX,
int offsetY,
int width,
int height,
boolean drawsSelf)
drawAndUpdateWidget in class Widgetprotected void init()
init in class Widget
protected abstract WindowHeaderWidget createHeaderWidget(WindowHeaderWidget.Description headerDesc,
java.lang.String title)
headerDesc - the description for the header Widgettitle - the Window's title
protected abstract WidgetContainer createContentPane(float width,
float height)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||