Ejemplo n.º 1
0
 public void changedUpdate(DocumentEvent changes, Shape a, ViewFactory f) {
   super.changedUpdate(changes, a, f);
   int pos = changes.getOffset();
   if (pos <= getStartOffset() && (pos + changes.getLength()) >= getEndOffset()) {
     setPropertiesFromAttributes();
   }
 }
 /**
  * Sets the size of the view. This should cause layout of the view along the given axis, if it has
  * any layout duties.
  *
  * @param width the width >= 0
  * @param height the height >= 0
  */
 public void setSize(float width, float height) {
   updateMetrics();
   if ((int) width != getWidth()) {
     // invalidate the view itself since the childrens
     // desired widths will be based upon this views width.
     preferenceChanged(null, true, true);
     widthChanging = true;
   }
   super.setSize(width, height);
   widthChanging = false;
 }
Ejemplo n.º 3
0
 /**
  * Establishes the parent view for this view. This is guaranteed to be called before any other
  * methods if the parent view is functioning properly.
  *
  * <p>This is implemented to forward to the superclass as well as call the {@link
  * #setPropertiesFromAttributes()} method to set the paragraph properties from the css attributes.
  * The call is made at this time to ensure the ability to resolve upward through the parents view
  * attributes.
  *
  * @param parent the new parent, or null if the view is being removed from a parent it was
  *     previously added to
  */
 public void setParent(View parent) {
   super.setParent(parent);
   if (parent != null) {
     setPropertiesFromAttributes();
   }
 }
Ejemplo n.º 4
0
 /**
  * Renders using the given rendering surface and area on that surface. This is implemented to
  * delegate to the css box painter to paint the border and background prior to the interior.
  *
  * @param g the rendering surface to use
  * @param allocation the allocated region to render into
  * @see View#paint
  */
 public void paint(Graphics g, Shape allocation) {
   Rectangle a = (Rectangle) allocation;
   painter.paint(g, a.x, a.y, a.width, a.height, this);
   super.paint(g, a);
 }