WebCab JGraph v2.0

com.webcab.beans.newchart
Class Pictogram

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Canvas
              |
              +--com.webcab.beans.newchart.Pictogram
All Implemented Interfaces:
Accessible, ActionListener, ComponentListener, EventListener, ImageObserver, MenuContainer, MouseListener, Serializable

public class Pictogram
extends Canvas
implements Serializable, ComponentListener, MouseListener, ActionListener

The Pictogram is a Java BeanTM that helps you to plot professional pictograms. The data is read from a specified database that contains numeric values. The pictogram works almost like a bar chart but instead of bars it uses images.

Author:
WebCab Components
See Also:
Serialized Form

Field Summary
static int ASCENDING_LABELS
          This value indicates that the components will be sorted ascending acording to their labels.
static int ASCENDING_VALUES
          This value indicates that the components will be sorted ascending acording to their values.
static int DESCENDING_LABELS
          This value indicates that the components will be sorted descending acording to their labels.
static int DESCENDING_VALUES
          This value indicates that the components will be sorted descending acording to their values.
static int RESET
          This value indicates that the components will return to the original order.
 
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
Pictogram()
          Constructs a new Pictogram object.
 
Method Summary
 void actionPerformed(ActionEvent e)
           
 void componentHidden(ComponentEvent e)
           
 void componentMoved(ComponentEvent e)
           
 void componentResized(ComponentEvent e)
           
 void componentShown(ComponentEvent e)
           
 Color getBackground()
          Gets the current background color.
 String getDataUrl()
          Gets the string representation of the URL where to find data.
 Font getFont()
          Gets the current font.
 String getImageUrl()
          Gets the string representation of the URL where to find the background image.
 String getJDBCDriver()
          Gets the current JDBC driver.
 String getJDBCPassword()
          Gets the current JDBC password.
 String getJDBCQuery()
          Gets the current JDBC query.
 String getJDBCUrl()
          Gets the current JDBC URL.
 String getJDBCUser()
          Gets the current JDBC user.
 Dimension getMinimumSize()
           
 String getName()
          Gets the name of the pictogram.
 int getOrder()
          Gets the current sorting method.
 Color getTextColor()
          Gets the current text color.
 double getValueForKey()
          Gets the current value of the image.
 void mouseClicked(MouseEvent e)
           
 void mouseEntered(MouseEvent e)
           
 void mouseExited(MouseEvent e)
           
 void mousePressed(MouseEvent e)
           
 void mouseReleased(MouseEvent e)
           
 void paint(Graphics g)
           
 void setBackground(Color col)
          Sets the background color.
 void setDataUrl(String url)
          Sets the string representation of the URL where the program can find the data set to be displayed.
 void setFont(Font font)
          Sets the current font.
 void setImageUrl(String url)
          Sets the string representation of the URL where the program should find an valid image to use as background.
 void setJDBCDriver(String driver)
          This method only sends a new driver to the JavaBeans component.
 void setJDBCPassword(String value)
          This method only registers this value as the next value to use when sending the next query.
 void setJDBCQuery(String query)
          This method tries to send the specified query to the JDBC server (as previously registered with the setJDBCDriver and the setJDBCUrl methods.
 void setJDBCUrl(String url)
          This method only registers this url as the next url to use when sending the next query.
 void setJDBCUser(String value)
          This method only registers this user as the next user to use when sending the next query.
 void setName(String name)
          Sets the name of the pictogram.
 void setOrder(int Order)
          Specifies what type of sorting method should be used.
 void setTextColor(Color col)
          Sets the text color.
 void setValueForKey(double key)
          Specifies the value the each image represents.
 void update(Graphics g)
           
 
Methods inherited from class java.awt.Canvas
addNotify, getAccessibleContext
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, bounds, checkImage, checkImage, contains, contains, createImage, createImage, deliverEvent, disable, dispatchEvent, doLayout, enable, enable, enableInputMethods, getAlignmentX, getAlignmentY, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentOrientation, getCursor, getDropTarget, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getInputContext, getInputMethodRequests, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getParent, getPeer, getPreferredSize, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isDisplayable, isDoubleBuffered, isEnabled, isFocusTraversable, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setForeground, setLocale, setLocation, setLocation, setSize, setSize, setVisible, show, show, size, toString, transferFocus, validate
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

RESET

public static final int RESET
This value indicates that the components will return to the original order.

ASCENDING_VALUES

public static final int ASCENDING_VALUES
This value indicates that the components will be sorted ascending acording to their values.

DESCENDING_VALUES

public static final int DESCENDING_VALUES
This value indicates that the components will be sorted descending acording to their values.

ASCENDING_LABELS

public static final int ASCENDING_LABELS
This value indicates that the components will be sorted ascending acording to their labels.

DESCENDING_LABELS

public static final int DESCENDING_LABELS
This value indicates that the components will be sorted descending acording to their labels.
Constructor Detail

Pictogram

public Pictogram()
Constructs a new Pictogram object.
Method Detail

mouseClicked

public void mouseClicked(MouseEvent e)
Specified by:
mouseClicked in interface MouseListener

mousePressed

public void mousePressed(MouseEvent e)
Specified by:
mousePressed in interface MouseListener

mouseReleased

public void mouseReleased(MouseEvent e)
Specified by:
mouseReleased in interface MouseListener

mouseEntered

public void mouseEntered(MouseEvent e)
Specified by:
mouseEntered in interface MouseListener

mouseExited

public void mouseExited(MouseEvent e)
Specified by:
mouseExited in interface MouseListener

actionPerformed

public void actionPerformed(ActionEvent e)
Specified by:
actionPerformed in interface ActionListener

componentHidden

public void componentHidden(ComponentEvent e)
Specified by:
componentHidden in interface ComponentListener

componentMoved

public void componentMoved(ComponentEvent e)
Specified by:
componentMoved in interface ComponentListener

componentResized

public void componentResized(ComponentEvent e)
Specified by:
componentResized in interface ComponentListener

componentShown

public void componentShown(ComponentEvent e)
Specified by:
componentShown in interface ComponentListener

setJDBCDriver

public void setJDBCDriver(String driver)
This method only sends a new driver to the JavaBeans component. It will not take effect until a new query is sent to the JDBC server.

setJDBCUrl

public void setJDBCUrl(String url)
This method only registers this url as the next url to use when sending the next query. It will not take effect until the setJDBCQuery method is actually run.

setJDBCQuery

public void setJDBCQuery(String query)
This method tries to send the specified query to the JDBC server (as previously registered with the setJDBCDriver and the setJDBCUrl methods. It requires that the query return a ResultSet containing such: 1. double (the x coordinate) 2. double (the y coordinate)

The method will not throw an exception, instead it will print its stack-trace. Please send a request if you wish it to be in any other way.


getJDBCDriver

public String getJDBCDriver()
Gets the current JDBC driver.

getJDBCUrl

public String getJDBCUrl()
Gets the current JDBC URL.

getJDBCQuery

public String getJDBCQuery()
Gets the current JDBC query.

setJDBCUser

public void setJDBCUser(String value)
This method only registers this user as the next user to use when sending the next query. It will not take effect until the setJDBCQuery method is actually run.

getJDBCUser

public String getJDBCUser()
Gets the current JDBC user.

setJDBCPassword

public void setJDBCPassword(String value)
This method only registers this value as the next value to use when sending the next query. It will not take effect until the setJDBCQuery method is actually run.

getJDBCPassword

public String getJDBCPassword()
Gets the current JDBC password.

setName

public void setName(String name)
Sets the name of the pictogram. If you type a blank string as name, the name will be disabled.
Overrides:
setName in class Component
Parameters:
name - the string to use as name of the pictogram.

getName

public String getName()
Gets the name of the pictogram.
Overrides:
getName in class Component

setDataUrl

public void setDataUrl(String url)
Sets the string representation of the URL where the program can find the data set to be displayed.
Parameters:
url - string representation of the URL.

getDataUrl

public String getDataUrl()
Gets the string representation of the URL where to find data.

setOrder

public void setOrder(int Order)
Specifies what type of sorting method should be used. Predefined constants can be used to select the sorting method or the following values:
Parameters:
Order - the order to use

getOrder

public int getOrder()
Gets the current sorting method.
See Also:
setOrder(int)

setBackground

public void setBackground(Color col)
Sets the background color.
Overrides:
setBackground in class Component
Parameters:
col - the color to be used as background.

getBackground

public Color getBackground()
Gets the current background color.
Overrides:
getBackground in class Component

setTextColor

public void setTextColor(Color col)
Sets the text color.
Parameters:
col - color of the text.

getTextColor

public Color getTextColor()
Gets the current text color.

setImageUrl

public void setImageUrl(String url)
Sets the string representation of the URL where the program should find an valid image to use as background. Valid images are JPEG, GIF and PNG.
Parameters:
url - string representation of the URL.

getImageUrl

public String getImageUrl()
Gets the string representation of the URL where to find the background image.

getMinimumSize

public Dimension getMinimumSize()
Overrides:
getMinimumSize in class Component

setValueForKey

public void setValueForKey(double key)
Specifies the value the each image represents.
Parameters:
key - the value of each image.

getValueForKey

public double getValueForKey()
Gets the current value of the image.

setFont

public void setFont(Font font)
Sets the current font.
Overrides:
setFont in class Component
Parameters:
font - the font to be used.

getFont

public Font getFont()
Gets the current font.
Overrides:
getFont in class Component

paint

public void paint(Graphics g)
Overrides:
paint in class Canvas

update

public void update(Graphics g)
Overrides:
update in class Component

WebCab JGraph v2.0