|
||||||||||
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.Panel
java.applet.Applet
javax.swing.JApplet
org.openswing.swing.util.client.ClientUtils
Title: OpenSwing Framework
Description: Help singleton class used to comunicate with the external environment, like the server side (via HTTP) or to fetch external resources (XML, images). It is also the main applet to execute: so this class can be derived to access to applet methods (start method...)
Copyright: Copyright (C) 2006 Mauro Carniel
This file is part of OpenSwing Framework. This library is free software; you can redistribute it and/or modify it under the terms of the (LGPL) Lesser General Public License as published by the Free Software Foundation; GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. The author may be contacted at: maurocarniel@tin.it
Field Summary |
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 | |
ClientUtils()
|
Method Summary | |
static void |
addBusyListener(BusyListener busyListener)
Add a listener of busy state events. |
static void |
addTabListener(javax.swing.JComponent c)
Utility method invoked by input controls in order to listen for a AS_TAB key event to translate in a TAB key event, to transfer focus to next component. |
static void |
centerDialog(javax.swing.JFrame parentFrame,
javax.swing.JDialog d)
Place the dialog window in the middle of parentFrame. |
static void |
centerFrame(javax.swing.JFrame frame)
Place the window in the middle of the desktop. |
static void |
centerWindow(javax.swing.JFrame parentFrame,
java.awt.Window w)
Place the window in the middle of parentFrame. |
static java.lang.Object |
convertObject(java.lang.Object value,
java.lang.Class targetType)
|
static void |
displayURL(java.lang.String url)
Show a document in a specified viewer. |
static void |
disposeComponents(java.awt.Component[] c)
Remove components no more used. |
static void |
fireBusyEvent(boolean busy)
|
static Response |
getData(java.lang.String serverMethodName,
java.lang.Object param)
Send a request to the server side via HTTP. |
static java.awt.Image |
getImage(java.lang.String imageName)
|
static java.awt.Image |
getImage(java.lang.String imageName,
java.lang.Class clazz)
|
static Form |
getLinkedForm(javax.swing.JComponent comp)
|
static javax.swing.JFrame |
getParentFrame(javax.swing.JComponent comp)
|
static javax.swing.JInternalFrame |
getParentInternalFrame(javax.swing.JComponent comp)
|
static java.beans.PropertyDescriptor |
getPropertyDescriptor(java.lang.Class clazz,
java.lang.String attributeName)
|
static java.lang.String |
getServerURL()
|
static java.lang.Object |
getValue(ValueObject vo,
java.lang.String attributeName)
|
void |
init()
|
static void |
removeBusyListener(BusyListener busyListener)
Remove a listener of busy state events. |
static void |
setObjectSender(ObjectSender objectSender)
Set the sender to use inside "getData" method to comunicate with a remote site via HTTP. |
static void |
setSessionId(java.lang.String id)
Set the session id associated to the current client |
static void |
showDocument(java.lang.String docId)
Show the specified document in a browser window. |
Methods inherited from class javax.swing.JApplet |
getAccessibleContext, getContentPane, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, remove, setContentPane, setGlassPane, setJMenuBar, setLayeredPane, setLayout, update |
Methods inherited from class java.applet.Applet |
destroy, getAppletContext, getAppletInfo, getAudioClip, getAudioClip, getCodeBase, getDocumentBase, getImage, getImage, getLocale, getParameter, getParameterInfo, isActive, newAudioClip, play, play, resize, resize, setStub, showStatus, start, stop |
Methods inherited from class java.awt.Panel |
addNotify |
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, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, remove, removeAll, removeContainerListener, removeNotify, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, 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, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocusInWindow, reshape, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public ClientUtils()
Method Detail |
public final void init()
public static javax.swing.JFrame getParentFrame(javax.swing.JComponent comp)
comp
- graphic component which is contained into a JFrame
public static javax.swing.JInternalFrame getParentInternalFrame(javax.swing.JComponent comp)
comp
- graphic component which is contained into a JInternalFrame
public static java.awt.Image getImage(java.lang.String imageName)
imageName
- image name; must be stored in the "image" folder accessible by the classpath
public static java.awt.Image getImage(java.lang.String imageName, java.lang.Class clazz)
imageName
- image name; must be stored in the "image" folder accessible by the classpath
public static void centerDialog(javax.swing.JFrame parentFrame, javax.swing.JDialog d)
parentFrame
- parent frame containing the dialogd
- dialog window to centerpublic static void centerWindow(javax.swing.JFrame parentFrame, java.awt.Window w)
parentFrame
- parent frame containing the dialogw
- window to centerpublic static void centerFrame(javax.swing.JFrame frame)
frame
- frame to centerpublic static java.lang.String getServerURL() throws java.lang.Exception
java.lang.Exception
public static final Response getData(java.lang.String serverMethodName, java.lang.Object param)
serverMethodName
- nome metodo lato server da contattareparam
- parametro da passare al metodo
public static void setSessionId(java.lang.String id)
id
- session id associated to the current clientpublic static void showDocument(java.lang.String docId) throws java.lang.Exception
docId
- document identifier
java.lang.Exception
public static void displayURL(java.lang.String url)
url
- local URIpublic static Form getLinkedForm(javax.swing.JComponent comp)
comp
- component linked to a Form object
public static final void addBusyListener(BusyListener busyListener)
busyListener
- listener of busy state eventspublic static final void removeBusyListener(BusyListener busyListener)
busyListener
- listener of busy state eventspublic static final void fireBusyEvent(boolean busy)
public static final java.beans.PropertyDescriptor getPropertyDescriptor(java.lang.Class clazz, java.lang.String attributeName) throws java.lang.Exception
clazz
- Class to analyzeattributeName
- attribute name defined within the clazz
java.lang.Exception
public static final void setObjectSender(ObjectSender objectSender)
objectSender
- ObjectSender to setpublic static final void disposeComponents(java.awt.Component[] c)
public static final java.lang.Object convertObject(java.lang.Object value, java.lang.Class targetType)
value
- data to checktargetType
- type of data
public static java.lang.Object getValue(ValueObject vo, java.lang.String attributeName) throws java.lang.Exception
vo
- ValueObject to analyzeattributeName
- v.o. attribute name
java.lang.Exception
public static void addTabListener(javax.swing.JComponent c)
c
- input control to whose add a KeyListener
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |