|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.event.MouseAdapter
net.luniks.jtvd.ImagePanel.Item
net.luniks.jtvd.ImagePanel.MenuItem
This class is a special type of Item that can draw a shape
or change its text color when it is clicked or "mouseovered".
These effects are used as highlight or select effects.
The purpose of these items is to use them as menu buttons.
| Field Summary | |
protected boolean |
deleteable
|
protected int |
dx
|
protected int |
dy
|
protected java.awt.Font |
font
|
private java.awt.Color |
fontColor
|
protected int |
height
|
protected int |
id
|
protected boolean |
print
|
protected boolean |
selected
|
protected java.awt.Color |
selectedColor
|
protected java.awt.Rectangle |
selectedRect
|
protected java.awt.BasicStroke |
selectedStroke
|
private boolean |
shapeEffect
|
private java.awt.Color |
shapeEffectColor
|
private int |
shapeEffectPad
|
private java.awt.Rectangle |
shapeEffectRect
|
private java.awt.BasicStroke |
shapeEffectStroke
|
static int |
SHORT_TEXT_LENGTH
|
protected java.lang.String |
text
|
private boolean |
textEffect
|
private java.awt.Color |
textEffectColor
|
protected int |
textX
|
protected int |
textY
|
private java.lang.String |
title
|
protected int |
width
|
protected int |
x
|
protected int |
y
|
| Constructor Summary | |
ImagePanel.MenuItem(int id,
java.lang.String title,
int x,
int y)
|
|
| Method Summary | |
void |
draw(java.awt.Graphics2D g2d)
|
java.awt.Font |
getFont()
|
java.awt.Color |
getFontColor()
|
int |
getId()
|
boolean |
getPrint()
|
java.awt.Rectangle |
getRect()
|
java.awt.Color |
getSelectedColor()
|
boolean |
getShapeEffect()
|
java.awt.Color |
getShapeEffectColor()
|
int |
getShapeEffectPad()
|
java.awt.BasicStroke |
getShapeEffectStroke()
|
java.awt.geom.Rectangle2D |
getShapeRect()
Returns a Rectangle2D describing the location and size of this MenuItem. |
double |
getShapeX()
Returns the x coordinate of this item extended by the bounds of the shape representing the shape effect (if used) of this item. |
double |
getShapeY()
Returns the y coordinate of this item extended by the bounds of the shape representing the shape effect (if used) of this item. |
java.lang.String |
getShortText()
|
java.lang.String |
getShortTitle()
|
java.lang.String |
getText()
|
boolean |
getTextEffect()
|
java.awt.Color |
getTextEffectColor()
|
java.lang.String |
getTitle()
|
int |
getX()
|
int |
getY()
|
boolean |
isDeleteable()
|
boolean |
isSelected()
|
void |
keyPressed(java.awt.event.KeyEvent ke)
|
void |
keyReleased(java.awt.event.KeyEvent ke)
|
void |
keyTyped(java.awt.event.KeyEvent ke)
|
void |
mouseDragged(java.awt.event.MouseEvent me)
|
void |
mouseMoved(java.awt.event.MouseEvent me)
|
void |
mousePressed(java.awt.event.MouseEvent me)
|
void |
setDeleteable(boolean deleteable)
|
void |
setFont(java.awt.Font font)
|
void |
setFontColor(java.awt.Color fontColor)
|
void |
setId(int id)
|
void |
setLocation(int x,
int y)
|
void |
setPrint(boolean print)
|
void |
setRect(java.awt.Rectangle selectedRect)
|
void |
setSelected(boolean selected)
|
void |
setSelectedColor(java.awt.Color selectedColor)
|
void |
setShapeEffect(boolean shapeEffect)
|
void |
setShapeEffectColor(java.awt.Color shapeEffectColor)
|
void |
setShapeEffectPad(int shapeEffectPad)
|
void |
setShapeEffectStroke(java.awt.BasicStroke shapeEffectStroke)
|
void |
setShapeX(int x)
Sets the x coordinate of this item extended by the bounds of the shape representing the shape effect (if used) of this item. |
void |
setShapeY(int y)
Sets the y coordinate of this item extended by the bounds of the shape representing the shape effect (if used) of this item. |
void |
setText(java.lang.String text)
|
void |
setTextEffect(boolean textEffect)
|
void |
setTextEffectColor(java.awt.Color textEffectColor)
|
void |
setTitle(java.lang.String title)
|
void |
setX(int x)
Sets the x coordinate of this item. |
void |
setY(int y)
Sets the y coordinate of this item. |
java.lang.String |
toString()
|
void |
validateLocation()
|
| Methods inherited from class java.awt.event.MouseAdapter |
mouseClicked, mouseEntered, mouseExited, mouseReleased |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
private java.lang.String title
private boolean shapeEffect
private boolean textEffect
private java.awt.Color fontColor
private java.awt.Color shapeEffectColor
private java.awt.Color textEffectColor
private java.awt.Rectangle shapeEffectRect
private java.awt.BasicStroke shapeEffectStroke
private int shapeEffectPad
public static final int SHORT_TEXT_LENGTH
protected int id
protected java.lang.String text
protected int x
protected int y
protected int dx
protected int dy
protected boolean selected
protected boolean print
protected java.awt.Rectangle selectedRect
protected java.awt.Color selectedColor
protected java.awt.Font font
protected java.awt.BasicStroke selectedStroke
protected int width
protected int height
protected int textX
protected int textY
protected boolean deleteable
| Constructor Detail |
public ImagePanel.MenuItem(int id,
java.lang.String title,
int x,
int y)
| Method Detail |
public void draw(java.awt.Graphics2D g2d)
draw in class ImagePanel.Itempublic void mousePressed(java.awt.event.MouseEvent me)
mousePressed in interface java.awt.event.MouseListenermousePressed in class ImagePanel.Itempublic void mouseMoved(java.awt.event.MouseEvent me)
mouseMoved in interface java.awt.event.MouseMotionListenermouseMoved in class ImagePanel.Itempublic void setTitle(java.lang.String title)
public void setShapeEffect(boolean shapeEffect)
public void setTextEffect(boolean textEffect)
public void setTextEffectColor(java.awt.Color textEffectColor)
public void setShapeEffectColor(java.awt.Color shapeEffectColor)
public void setShapeEffectStroke(java.awt.BasicStroke shapeEffectStroke)
public void setShapeEffectPad(int shapeEffectPad)
public void setShapeX(int x)
x - the new x coordinatepublic void setShapeY(int y)
y - the new y coordinatepublic java.lang.String getTitle()
public java.lang.String getShortTitle()
public boolean getShapeEffect()
public boolean getTextEffect()
public java.awt.Color getTextEffectColor()
public java.awt.Color getShapeEffectColor()
public java.awt.BasicStroke getShapeEffectStroke()
public int getShapeEffectPad()
public double getShapeX()
public double getShapeY()
public java.awt.geom.Rectangle2D getShapeRect()
public java.lang.String toString()
toString in class ImagePanel.Itempublic void mouseDragged(java.awt.event.MouseEvent me)
mouseDragged in interface java.awt.event.MouseMotionListenerpublic void keyPressed(java.awt.event.KeyEvent ke)
keyPressed in interface java.awt.event.KeyListenerpublic void keyReleased(java.awt.event.KeyEvent ke)
keyReleased in interface java.awt.event.KeyListenerpublic void keyTyped(java.awt.event.KeyEvent ke)
keyTyped in interface java.awt.event.KeyListenerpublic void setId(int id)
public void setText(java.lang.String text)
public void setX(int x)
x - the new x coordinatepublic void setY(int y)
y - the new y coordinate
public void setLocation(int x,
int y)
public void validateLocation()
public void setSelected(boolean selected)
public void setSelectedColor(java.awt.Color selectedColor)
public void setPrint(boolean print)
public void setRect(java.awt.Rectangle selectedRect)
public void setFontColor(java.awt.Color fontColor)
public void setFont(java.awt.Font font)
public void setDeleteable(boolean deleteable)
public int getId()
public java.lang.String getText()
public java.lang.String getShortText()
public int getX()
public int getY()
public boolean isSelected()
public boolean getPrint()
public java.awt.Rectangle getRect()
public java.awt.Color getSelectedColor()
public java.awt.Font getFont()
public java.awt.Color getFontColor()
public boolean isDeleteable()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||