|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.swing.text.View
sferyx.administration.renderers.CustomImageView
public class CustomImageView
CustomImageView paints the images inside the editor, fixing the Sun's API bug when painting resized gif images.
Field Summary | |
---|---|
protected java.awt.Rectangle |
fBounds
|
int |
height
|
protected java.awt.Image |
image
|
protected static java.lang.String |
IMAGE_CACHE_PROPERTY
Document property for image cache. |
protected static java.util.Hashtable |
imageCache
|
int |
width
|
Fields inherited from class javax.swing.text.View |
---|
BadBreakWeight, ExcellentBreakWeight, ForcedBreakWeight, GoodBreakWeight, X_AXIS, Y_AXIS |
Fields inherited from interface javax.swing.SwingConstants |
---|
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST |
Constructor Summary | |
---|---|
CustomImageView(javax.swing.text.Element elem)
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)
Invoked when the Elements attributes have changed. |
boolean |
containsImageMap()
|
protected void |
finalize()
|
int |
getAbsoluteX()
|
int |
getAbsoluteY()
|
float |
getAlignment(int axis)
Determines the desired alignment for this view along an axis. |
java.lang.String |
getAltText()
Returns the text to display if the image can't be loaded. |
javax.swing.text.AttributeSet |
getAttributes()
Fetches the attributes to use when rendering. |
int |
getBottomMargin()
|
int |
getBottomPadding()
|
int |
getBreakWeight(int axis,
float pos,
float len)
|
float |
getHeightCSSValue()
|
HTMLBrowser |
getHTMLEditor()
|
java.awt.Image |
getImage()
Returns the image to render. |
sferyx.administration.renderers.EditorHTMLDocument.CustomMap |
getImageMap()
|
java.net.URL |
getImageURL()
Return a URL for the image source, or null if it could not be determined. |
int |
getLeftMargin()
|
int |
getLeftPadding()
|
javax.swing.Icon |
getLoadingImageIcon()
Returns the icon to use while in the process of loading the image. |
boolean |
getLoadsSynchronously()
Returns true if the image should be loaded when first asked for. |
float |
getMaxHeightCSSValue()
|
float |
getMaximumSpan_(int axis)
|
float |
getMaximumSpan(int axis)
|
float |
getMaximumSpanNew(int axis)
|
float |
getMaxWidthCSSValue()
|
float |
getMinimumSpan_(int axis)
|
float |
getMinimumSpan(int axis)
|
float |
getMinWidthCSSValue()
|
javax.swing.Icon |
getNoImageIcon()
Returns the icon to use if the image couldn't be found. |
float |
getPreferredSpan_(int axis)
|
float |
getPreferredSpan(int axis)
Determines the preferred span for this view along an axis. |
int |
getResizeWeight(int axis)
|
int |
getRightMargin()
|
int |
getRightPadding()
|
protected javax.swing.text.html.StyleSheet |
getStyleSheet()
Convenience method to get the StyleSheet. |
java.lang.String |
getToolTipText(float x,
float y,
java.awt.Shape allocation)
For images the tooltip text comes from text specified with the ALT attribute. |
int |
getTopMargin()
|
int |
getTopPadding()
|
float |
getWidthCSSValue()
|
boolean |
isAbsolutePositioning()
|
boolean |
isFillSelected()
|
boolean |
isRelativePositioning()
|
boolean |
isSelected()
|
protected void |
loadImage()
|
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 |
paint(java.awt.Graphics g,
java.awt.Shape a)
|
void |
setLoadsSynchronously(boolean newValue)
Sets how the image is loaded. |
void |
setParent(javax.swing.text.View parent)
Establishes the parent view for this view. |
protected void |
setPropertiesFromAttributes()
Update any cached values that come from attributes. |
void |
setSize(float width,
float height)
Sets the size of the view. |
static java.awt.image.BufferedImage |
toBufferedImage(java.awt.Image img)
|
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, getChildAllocation, getContainer, getDocument, getElement, getEndOffset, getGraphics, getNextVisualPositionFrom, getParent, getStartOffset, 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, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final java.lang.String IMAGE_CACHE_PROPERTY
protected java.awt.Image image
public int width
public int height
protected java.awt.Rectangle fBounds
protected static java.util.Hashtable imageCache
Constructor Detail |
---|
public CustomImageView(javax.swing.text.Element elem)
elem
- the element to create a view forMethod Detail |
---|
public int getResizeWeight(int axis)
getResizeWeight
in class javax.swing.text.View
public int getBreakWeight(int axis, float pos, float len)
getBreakWeight
in class javax.swing.text.View
public boolean isAbsolutePositioning()
isAbsolutePositioning
in interface CSSLayoutViews
public boolean isRelativePositioning()
isRelativePositioning
in interface CSSLayoutViews
public int getAbsoluteX()
getAbsoluteX
in interface CSSLayoutViews
public int getAbsoluteY()
getAbsoluteY
in interface CSSLayoutViews
public HTMLBrowser getHTMLEditor()
public boolean isFillSelected()
public boolean isSelected()
public java.lang.String getAltText()
HTML.Attribute.ALT
.
public java.net.URL getImageURL()
public javax.swing.Icon getNoImageIcon()
public javax.swing.Icon getLoadingImageIcon()
public java.awt.Image getImage()
public void setLoadsSynchronously(boolean newValue)
newValue
is true,
the image we be loaded when first asked for, otherwise it will
be loaded asynchronously. The default is to not load synchronously,
that is to load the image asynchronously.
public boolean getLoadsSynchronously()
protected javax.swing.text.html.StyleSheet getStyleSheet()
public javax.swing.text.AttributeSet getAttributes()
getAttributes
in class javax.swing.text.View
public java.lang.String getToolTipText(float x, float y, java.awt.Shape allocation)
ALT
attribute. This is overriden to return
getAltText
.
getToolTipText
in class javax.swing.text.View
JTextComponent.getToolTipText(java.awt.event.MouseEvent)
protected void setPropertiesFromAttributes()
public int getRightMargin()
getRightMargin
in interface CSSLayoutViews
public int getLeftMargin()
getLeftMargin
in interface CSSLayoutViews
public int getTopMargin()
getTopMargin
in interface CSSLayoutViews
public int getBottomMargin()
getBottomMargin
in interface CSSLayoutViews
public int getRightPadding()
public int getLeftPadding()
public int getTopPadding()
public int getBottomPadding()
public void setParent(javax.swing.text.View parent)
setParent
in class javax.swing.text.View
public void changedUpdate(javax.swing.event.DocumentEvent e, java.awt.Shape a, javax.swing.text.ViewFactory f)
changedUpdate
in class javax.swing.text.View
public void paint(java.awt.Graphics g, java.awt.Shape a)
paint
in class javax.swing.text.View
public sferyx.administration.renderers.EditorHTMLDocument.CustomMap getImageMap()
public boolean containsImageMap()
public float getMaximumSpanNew(int axis)
public float getMaximumSpan(int axis)
getMaximumSpan
in class javax.swing.text.View
public float getMaximumSpan_(int axis)
public float getMaxWidthCSSValue()
public float getMaxHeightCSSValue()
public float getMinWidthCSSValue()
public float getMinimumSpan(int axis)
getMinimumSpan
in class javax.swing.text.View
public float getMinimumSpan_(int axis)
public float getPreferredSpan(int axis)
getPreferredSpan
in class javax.swing.text.View
axis
- may be either X_AXIS or Y_AXIS
public float getPreferredSpan_(int axis)
public float getHeightCSSValue()
public float getWidthCSSValue()
public float getAlignment(int axis)
getAlignment
in class javax.swing.text.View
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
modelToView
in class javax.swing.text.View
pos
- the position to converta
- the allocated region to render into
javax.swing.text.BadLocationException
- if the given position does not represent a
valid location in the associated documentView.modelToView(int, java.awt.Shape, javax.swing.text.Position.Bias)
public int viewToModel(float x, float y, java.awt.Shape a, javax.swing.text.Position.Bias[] bias)
viewToModel
in class javax.swing.text.View
x
- the X coordinatey
- the Y coordinatea
- the allocated region to render into
View.viewToModel(float, float, java.awt.Shape, javax.swing.text.Position.Bias[])
public void setSize(float width, float height)
setSize
in class javax.swing.text.View
width
- the width >= 0height
- the height >= 0public static java.awt.image.BufferedImage toBufferedImage(java.awt.Image img)
protected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable
protected void loadImage()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |