|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.swing.text.View
fr.ens.transcriptome.doelan.gui.MyImageView
Image viewer
Field Summary | |
static java.lang.String |
ABSMIDDLE
|
static java.lang.String |
BOTTOM
|
static java.lang.String |
CENTER
|
static java.lang.String |
MIDDLE
|
static java.lang.String |
TEXTTOP
|
static java.lang.String |
TOP
|
Fields inherited from class javax.swing.text.View |
BadBreakWeight, ExcellentBreakWeight, ForcedBreakWeight, GoodBreakWeight, X_AXIS, Y_AXIS |
Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Fields inherited from interface javax.swing.SwingConstants |
EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TRAILING, VERTICAL, WEST |
Constructor Summary | |
MyImageView(javax.swing.text.Element elem,
java.util.Map mapImage)
Creates a new view that represents an IMG element. |
Method Summary | |
void |
changedUpdate(javax.swing.event.DocumentEvent e,
java.awt.Shape a,
javax.swing.text.ViewFactory f)
My attributes may have changed. |
float |
getAlignment(int axis)
Determines the desired alignment for this view along an axis. |
javax.swing.text.AttributeSet |
getAttributes()
Fetches the attributes to use when rendering. |
protected java.awt.Color |
getHighlightColor()
Returns the text editor's highlight color. |
java.util.Map |
getMapImages()
Get the map of the images. |
float |
getPreferredSpan(int axis)
Determines the preferred span for this view along an axis. |
protected int |
getSelectionState()
Determines whether the image is selected, and if it's the only thing selected. |
protected javax.swing.text.html.StyleSheet |
getStyleSheet()
|
boolean |
imageUpdate(java.awt.Image img,
int flags,
int x,
int y,
int width,
int height)
Update the image. |
protected boolean |
isEditable()
|
java.awt.Shape |
modelToView(int pos,
java.awt.Shape a,
javax.swing.text.Position.Bias b)
Provides a mapping from the document model coordinate space to the coordinate space of the view mapped to it. |
void |
mouseClicked(java.awt.event.MouseEvent e)
On double-click, open image properties dialog. |
void |
mouseDragged(java.awt.event.MouseEvent e)
Resize image if initial click was in grow-box: |
void |
mouseEntered(java.awt.event.MouseEvent e)
Mouse event |
void |
mouseExited(java.awt.event.MouseEvent e)
Mouse event |
void |
mouseMoved(java.awt.event.MouseEvent e)
Mouse event |
void |
mousePressed(java.awt.event.MouseEvent e)
Select or grow image when clicked. |
void |
mouseReleased(java.awt.event.MouseEvent e)
Mouse event |
void |
paint(java.awt.Graphics g,
java.awt.Shape a)
Paints the image. |
protected void |
repaint(long delay)
Request that this view be repainted. |
protected void |
resize(int width,
int height)
Change the size of this image. |
void |
setMapImages(java.util.Map mapImages)
Set the map of the images. |
void |
setParent(javax.swing.text.View parent)
Establishes the parent view for this view. |
void |
setSize(float width,
float height)
Set the size of the view. |
int |
viewToModel(float x,
float y,
java.awt.Shape a,
javax.swing.text.Position.Bias[] bias)
Provides a mapping from the view coordinate space to the logical coordinate space of the model. |
Methods inherited from class javax.swing.text.View |
append, breakView, createFragment, forwardUpdate, forwardUpdateToView, getBreakWeight, getChildAllocation, getContainer, getDocument, getElement, getEndOffset, getGraphics, getMaximumSpan, getMinimumSpan, getNextVisualPositionFrom, getParent, getResizeWeight, getStartOffset, getToolTipText, getView, getViewCount, getViewFactory, getViewIndex, getViewIndex, insert, insertUpdate, isVisible, modelToView, modelToView, preferenceChanged, remove, removeAll, removeUpdate, replace, updateChildren, updateLayout, viewToModel |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String TOP
public static final java.lang.String TEXTTOP
public static final java.lang.String MIDDLE
public static final java.lang.String ABSMIDDLE
public static final java.lang.String CENTER
public static final java.lang.String BOTTOM
Constructor Detail |
public MyImageView(javax.swing.text.Element elem, java.util.Map mapImage)
elem
- the element to create a view formapImage
- The map with all the imagesMethod Detail |
public javax.swing.text.AttributeSet getAttributes()
public void setParent(javax.swing.text.View parent)
parent
- The parent of this viewpublic void changedUpdate(javax.swing.event.DocumentEvent e, java.awt.Shape a, javax.swing.text.ViewFactory f)
e
- DocumentEventa
- Shapef
- View factorypublic void paint(java.awt.Graphics g, java.awt.Shape a)
g
- the rendering surface to usea
- the allocated region to render intoView.paint(java.awt.Graphics, java.awt.Shape)
protected void repaint(long delay)
delay
- Delay to repaintprotected int getSelectionState()
protected boolean isEditable()
protected java.awt.Color getHighlightColor()
public boolean imageUpdate(java.awt.Image img, int flags, int x, int y, int width, int height)
imageUpdate
in interface java.awt.image.ImageObserver
img
- Imageflags
- Flagsx
- X coordinatey
- Y coordinatewidth
- Widthheight
- Height
public float getPreferredSpan(int axis)
axis
- may be either X_AXIS or Y_AXIS
public float getAlignment(int axis)
axis
- may be either X_AXIS or Y_AXIS
public java.awt.Shape modelToView(int pos, java.awt.Shape a, javax.swing.text.Position.Bias b) throws javax.swing.text.BadLocationException
pos
- the position to converta
- the allocated region to render intob
- ???
javax.swing.text.BadLocationException
- if the given position does not represent a
valid location in the associated documentmodelToView
public int viewToModel(float x, float y, java.awt.Shape a, javax.swing.text.Position.Bias[] bias)
x
- the X coordinatey
- the Y coordinatea
- the allocated region to render intobias
- ???
viewToModel
public void setSize(float width, float height)
width
- the widthheight
- the heightprotected void resize(int width, int height)
public void mousePressed(java.awt.event.MouseEvent e)
mousePressed
in interface java.awt.event.MouseListener
e
- Mouse event.public void mouseDragged(java.awt.event.MouseEvent e)
mouseDragged
in interface java.awt.event.MouseMotionListener
e
- Mouse eventpublic void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased
in interface java.awt.event.MouseListener
e
- Mouse eventpublic void mouseClicked(java.awt.event.MouseEvent e)
mouseClicked
in interface java.awt.event.MouseListener
e
- Mouse eventpublic void mouseEntered(java.awt.event.MouseEvent e)
mouseEntered
in interface java.awt.event.MouseListener
e
- Mouse eventpublic void mouseMoved(java.awt.event.MouseEvent e)
mouseMoved
in interface java.awt.event.MouseMotionListener
e
- Mouse eventpublic void mouseExited(java.awt.event.MouseEvent e)
mouseExited
in interface java.awt.event.MouseListener
e
- Mouse eventprotected javax.swing.text.html.StyleSheet getStyleSheet()
public java.util.Map getMapImages()
public void setMapImages(java.util.Map mapImages)
mapImages
- The mapImages to set
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |