javax.swing.text.html
Class BlockView
- SwingConstants
BOTTOM , CENTER , EAST , HORIZONTAL , LEADING , LEFT , NEXT , NORTH , NORTH_EAST , NORTH_WEST , PREVIOUS , RIGHT , SOUTH , SOUTH_EAST , SOUTH_WEST , TOP , TRAILING , VERTICAL , WEST |
BlockView(Element elem, int axis) - Creates a new view that represents an html box.
|
protected SizeRequirements | calculateMajorAxisRequirements(int axis, SizeRequirements r) - Calculates the requirements along the major axis.
|
protected SizeRequirements | calculateMinorAxisRequirements(int axis, SizeRequirements r) - Calculates the requirements along the minor axis.
|
void | changedUpdate(DocumentEvent ev, Shape a, ViewFactory f) - Gives notification from the document that attributes were
changed in a location that this view is responsible for.
|
float | getAlignment(int axis) - Gets the alignment.
|
AttributeSet | getAttributes() - Fetches the attributes to use when painting.
|
float | getMaximumSpan(int axis) - Determines the maximum span along the axis.
|
float | getMinimumSpan(int axis) - Determines the minimum span along the axis.
|
float | getPreferredSpan(int axis) - Determines the preferred span along the axis.
|
int | getResizeWeight(int axis) - Gets the resize weight.
|
protected StyleSheet | getStyleSheet() - Gets the default style sheet.
|
protected void | layoutMajorAxis(int targetSpan, int axis, int[] offsets, int[] spans) - Overridden to perform additional CSS layout (absolute/relative
positioning).
|
protected void | layoutMinorAxis(int targetSpan, int axis, int[] offsets, int[] spans) - Lays out the box along the minor axis (the axis that is
perpendicular to the axis that it represents).
|
void | paint(Graphics g, Shape a) - Paints using the given graphics configuration and shape.
|
void | replace(int offset, int length, View[] views) - Overridden to fetch additional CSS layout information.
|
void | setParent(View parent) - Creates the parent view for this.
|
protected void | setPropertiesFromAttributes() - Updates any cached values that come from attributes.
|
baselineLayout , baselineRequirements , calculateMajorAxisRequirements , calculateMinorAxisRequirements , childAllocation , flipEastAndWestAtEnds , forwardUpdate , getAlignment , getAxis , getChildAllocation , getHeight , getMaximumSpan , getMinimumSpan , getOffset , getPreferredSpan , getResizeWeight , getSpan , getViewAtPoint , getWidth , isAfter , isAllocationValid , isBefore , isLayoutValid , layout , layoutChanged , layoutMajorAxis , layoutMinorAxis , modelToView , paint , paintChild , preferenceChanged , replace , setAxis , setSize , viewToModel |
childAllocation , flipEastAndWestAtEnds , getBottomInset , getChildAllocation , getInsideAllocation , getLeftInset , getNextEastWestVisualPositionFrom , getNextNorthSouthVisualPositionFrom , getNextVisualPositionFrom , getRightInset , getTopInset , getView , getViewAtPoint , getViewAtPosition , getViewCount , getViewIndex , getViewIndexAtPosition , isAfter , isBefore , loadChildren , modelToView , modelToView , replace , setInsets , setParagraphInsets , setParent , viewToModel |
append , breakView , changedUpdate , createFragment , dump , forwardUpdate , forwardUpdateToView , getAlignment , getAttributes , getBreakWeight , getChildAllocation , getContainer , getDocument , getElement , getEndOffset , getGraphics , getMaximumSpan , getMinimumSpan , getNextVisualPositionFrom , getParent , getPreferredSpan , getResizeWeight , getStartOffset , getToolTipText , getView , getViewCount , getViewFactory , getViewIndex , getViewIndex , insert , insertUpdate , isVisible , modelToView , modelToView , modelToView , paint , preferenceChanged , remove , removeAll , removeUpdate , replace , setParent , setSize , updateChildren , updateLayout , viewToModel , viewToModel |
clone , equals , extends Object> getClass , finalize , hashCode , notify , notifyAll , toString , wait , wait , wait |
BlockView
public BlockView(Element elem,
int axis)
Creates a new view that represents an html box.
This can be used for a number of elements.
elem
- - the element to create a view foraxis
- - either View.X_AXIS or View.Y_AXIS
changedUpdate
public void changedUpdate(DocumentEvent ev,
Shape a,
ViewFactory f)
Gives notification from the document that attributes were
changed in a location that this view is responsible for.
- changedUpdate in interface View
ev
- - the change informationa
- - the current shape of the viewf
- - the factory to use to rebuild if the view has children.
getMaximumSpan
public float getMaximumSpan(int axis)
throws IllegalArgumentException
Determines the maximum span along the axis.
- getMaximumSpan in interface BoxView
axis
- - the axis to get the maximum span for.
- the span the view would like to be painted into >=0/
The view is usually told to paint into the span that is returned,
although the parent may choose to resize or break the view.
getMinimumSpan
public float getMinimumSpan(int axis)
throws IllegalArgumentException
Determines the minimum span along the axis.
- getMinimumSpan in interface BoxView
axis
- - the axis to get the minimum span for.
- the span the view would like to be painted into >=0/
The view is usually told to paint into the span that is returned,
although the parent may choose to resize or break the view.
getPreferredSpan
public float getPreferredSpan(int axis)
throws IllegalArgumentException
Determines the preferred span along the axis.
- getPreferredSpan in interface BoxView
axis
- - the view to get the preferred span for.
- the span the view would like to be painted into >=0/
The view is usually told to paint into the span that is returned,
although the parent may choose to resize or break the view.
layoutMajorAxis
protected void layoutMajorAxis(int targetSpan,
int axis,
int[] offsets,
int[] spans)
Overridden to perform additional CSS layout (absolute/relative
positioning).
- layoutMajorAxis in interface BoxView
layoutMinorAxis
protected void layoutMinorAxis(int targetSpan,
int axis,
int[] offsets,
int[] spans)
Lays out the box along the minor axis (the axis that is
perpendicular to the axis that it represents). The results
of the layout are placed in the given arrays which are
the allocations to the children along the minor axis.
- layoutMinorAxis in interface BoxView
targetSpan
- - the total span given to the view, also
used to layout the children.axis
- - the minor axisoffsets
- - the offsets from the origin of the view for
all the child views. This is a return value and is filled in by this
function.spans
- - the span of each child view. This is a return value and is
filled in by this function.
paint
public void paint(Graphics g,
Shape a)
Paints using the given graphics configuration and shape.
This delegates to the css box painter to paint the
border and background prior to the interior.
- paint in interface BoxView
g
- - Graphics configurationa
- - the Shape to render into.
replace
public void replace(int offset,
int length,
View[] views)
Overridden to fetch additional CSS layout information.
- replace in interface BoxView
setParent
public void setParent(View parent)
Creates the parent view for this. It is called before
any other methods, if the parent view is working properly.
Implemented to forward to the superclass and call
setPropertiesFromAttributes to set the paragraph
properties.
- setParent in interface CompositeView
parent
- - the new parent, or null if the view
is being removed from a parent it was added to.
BlockView.java --
Copyright (C) 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version.