calculateMajorAxisRequirements
protected SizeRequirements calculateMajorAxisRequirements(int axis,
SizeRequirements r)
Calculates the requirements along the major axis.
This is implemented to call the superclass and then
adjust it if the CSS width or height attribute is specified
and applicable.
- Overrides:
- calculateMajorAxisRequirements in interface BoxView
- Parameters:
axis - - the axis to check the requirements for.r - - the SizeRequirements. If null, one is created.
- Returns:
- the new SizeRequirements object.
calculateMinorAxisRequirements
protected SizeRequirements calculateMinorAxisRequirements(int axis,
SizeRequirements r)
Calculates the requirements along the minor axis.
This is implemented to call the superclass and then
adjust it if the CSS width or height attribute is specified
and applicable.
- Overrides:
- calculateMinorAxisRequirements in interface BoxView
- Parameters:
axis - - the axis to check the requirements for.r - - the SizeRequirements. If null, one is created.
- Returns:
- the new SizeRequirements object.
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.
- Overrides:
- changedUpdate in interface View
- Parameters:
ev - - the change informationa - - the current shape of the viewf - - the factory to use to rebuild if the view has children.
getAlignment
public float getAlignment(int axis)
Gets the alignment.
- Overrides:
- getAlignment in interface BoxView
- Parameters:
axis - - the axis to get the alignment for.
getMaximumSpan
public float getMaximumSpan(int axis)
throws IllegalArgumentException
Determines the maximum span along the axis.
- Overrides:
- getMaximumSpan in interface BoxView
- Parameters:
axis - - the axis to get the maximum span for.
- Returns:
- 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.
- Overrides:
- getMinimumSpan in interface BoxView
- Parameters:
axis - - the axis to get the minimum span for.
- Returns:
- 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.
- Overrides:
- getPreferredSpan in interface BoxView
- Parameters:
axis - - the view to get the preferred span for.
- Returns:
- 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).
- Overrides:
- 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.
- Overrides:
- layoutMinorAxis in interface BoxView
- Parameters:
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.
- Overrides:
- paint in interface BoxView
- Parameters:
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.
- Overrides:
- 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.
- Overrides:
- setParent in interface CompositeView
- Parameters:
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.