public class JosmImageView extends javax.swing.text.html.ImageView
Modifier and Type | Field and Description |
---|---|
private static int |
HEIGHT_FLAG |
private java.lang.reflect.Field |
heightField |
private java.lang.reflect.Field |
imageField |
private static int |
LOADING_FLAG |
private static int |
RELOAD_FLAG |
private static int |
RELOAD_IMAGE_FLAG |
private java.lang.reflect.Field |
stateField |
private static int |
WIDTH_FLAG |
private java.lang.reflect.Field |
widthField |
Constructor and Description |
---|
JosmImageView(javax.swing.text.Element elem)
Constructs a new
JosmImageView . |
Modifier and Type | Method and Description |
---|---|
private void |
doLoadImage()
Loads the image from the URL
getImageURL . |
private void |
doRefreshImage()
Loads the image and updates the size accordingly.
|
private void |
doSync()
Makes sure the necessary properties and image is loaded.
|
javax.swing.text.AttributeSet |
getAttributes() |
private static java.lang.reflect.Field |
getDeclaredField(java.lang.String name) |
java.awt.Image |
getImage() |
float |
getPreferredSpan(int axis) |
void |
paint(java.awt.Graphics g,
java.awt.Shape a) |
void |
setSize(float width,
float height) |
changedUpdate, getAlignment, getAltText, getImageURL, getLoadingImageIcon, getLoadsSynchronously, getNoImageIcon, getStyleSheet, getToolTipText, modelToView, setLoadsSynchronously, setParent, setPropertiesFromAttributes, viewToModel
append, breakView, createFragment, forwardUpdate, forwardUpdateToView, getBreakWeight, getChildAllocation, getContainer, getDocument, getElement, getEndOffset, getGraphics, getMaximumSpan, getMinimumSpan, getNextVisualPositionFrom, getParent, getResizeWeight, getStartOffset, getView, getViewCount, getViewFactory, getViewIndex, getViewIndex, insert, insertUpdate, isVisible, modelToView, modelToView, preferenceChanged, remove, removeAll, removeUpdate, replace, updateChildren, updateLayout, viewToModel
private static final int LOADING_FLAG
private static final int WIDTH_FLAG
private static final int HEIGHT_FLAG
private static final int RELOAD_FLAG
private static final int RELOAD_IMAGE_FLAG
private final java.lang.reflect.Field imageField
private final java.lang.reflect.Field stateField
private final java.lang.reflect.Field widthField
private final java.lang.reflect.Field heightField
public JosmImageView(javax.swing.text.Element elem) throws java.lang.NoSuchFieldException
JosmImageView
.elem
- the element to create a view forjava.lang.SecurityException
- see Class.getDeclaredField(java.lang.String)
for detailsjava.lang.NoSuchFieldException
- see Class.getDeclaredField(java.lang.String)
for detailsprivate static java.lang.reflect.Field getDeclaredField(java.lang.String name) throws java.lang.NoSuchFieldException
java.lang.NoSuchFieldException
private void doSync()
private void doRefreshImage() throws java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException, java.lang.NoSuchMethodException
loadImage
or
updateImageSize
directly.java.lang.IllegalAccessException
- see Field.set(java.lang.Object, java.lang.Object)
and Method.invoke(java.lang.Object, java.lang.Object...)
for detailsjava.lang.IllegalArgumentException
- see Field.set(java.lang.Object, java.lang.Object)
and Method.invoke(java.lang.Object, java.lang.Object...)
for detailsjava.lang.reflect.InvocationTargetException
- see Method.invoke(java.lang.Object, java.lang.Object...)
for detailsjava.lang.NoSuchMethodException
- see Class.getDeclaredMethod(java.lang.String, java.lang.Class<?>...)
for detailsjava.lang.SecurityException
- see Class.getDeclaredMethod(java.lang.String, java.lang.Class<?>...)
for detailsprivate void doLoadImage() throws java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException, java.lang.NoSuchMethodException
getImageURL
. This should
only be invoked from refreshImage
.java.lang.IllegalAccessException
- see Field.set(java.lang.Object, java.lang.Object)
and Method.invoke(java.lang.Object, java.lang.Object...)
for detailsjava.lang.IllegalArgumentException
- see Field.set(java.lang.Object, java.lang.Object)
and Method.invoke(java.lang.Object, java.lang.Object...)
for detailsjava.lang.reflect.InvocationTargetException
- see Method.invoke(java.lang.Object, java.lang.Object...)
for detailsjava.lang.NoSuchMethodException
- see Class.getDeclaredMethod(java.lang.String, java.lang.Class<?>...)
for detailsjava.lang.SecurityException
- see Class.getDeclaredMethod(java.lang.String, java.lang.Class<?>...)
for detailspublic java.awt.Image getImage()
getImage
in class javax.swing.text.html.ImageView
public javax.swing.text.AttributeSet getAttributes()
getAttributes
in class javax.swing.text.html.ImageView
public void paint(java.awt.Graphics g, java.awt.Shape a)
paint
in class javax.swing.text.html.ImageView
public float getPreferredSpan(int axis)
getPreferredSpan
in class javax.swing.text.html.ImageView
public void setSize(float width, float height)
setSize
in class javax.swing.text.html.ImageView