Examples of Dimensions


Examples of org.apache.pivot.wtk.Dimensions

        return averageCharacterSize.height + (padding.top + padding.bottom) + 2;
    }

    @Override
    public Dimensions getPreferredSize() {
        return new Dimensions(getPreferredWidth(-1), getPreferredHeight(-1));
    }
View Full Code Here

Examples of org.apache.pivot.wtk.Dimensions

        GlyphVector missingGlyphVector = font.createGlyphVector(FONT_RENDER_CONTEXT,
            new int[] {missingGlyphCode});
        Rectangle2D textBounds = missingGlyphVector.getLogicalBounds();

        Rectangle2D maxCharBounds = font.getMaxCharBounds(FONT_RENDER_CONTEXT);
        averageCharacterSize = new Dimensions((int)Math.ceil(textBounds.getWidth()),
            (int)Math.ceil(maxCharBounds.getHeight()));

        invalidateComponent();
    }
View Full Code Here

Examples of org.apache.pivot.wtk.Dimensions

        CalendarButton calendarButton = (CalendarButton) getComponent();

        Button.DataRenderer dataRenderer = calendarButton.getDataRenderer();
        dataRenderer.render(calendarButton.getButtonData(), calendarButton, false);

        Dimensions contentSize = dataRenderer.getPreferredSize();
        int preferredWidth = contentSize.width + TRIGGER_WIDTH + padding.left + padding.right + 2;
        int preferredHeight = contentSize.height + padding.top + padding.bottom + 2;

        return new Dimensions(preferredWidth, preferredHeight);
    }
View Full Code Here

Examples of org.apache.pivot.wtk.Dimensions

                int height = getHeight();

                // Ensure that the popup remains within the bounds of the display
                Point buttonLocation = calendarButton.mapPointToAncestor(display, 0, 0);

                Dimensions displaySize = display.getSize();

                calendarPopup.setPreferredSize(-1, -1);
                Dimensions popupSize = calendarPopup.getPreferredSize();
                int popupWidth = Math.max(popupSize.width, calendarButton.getWidth());
                int popupHeight = popupSize.height;

                int x = buttonLocation.x;
                if (popupWidth > width
View Full Code Here

Examples of org.apache.pivot.wtk.Dimensions

            + spacing * 2;

        int preferredHeight = Math.max(BUTTON_DIAMETER,
            dataRenderer.getPreferredHeight(-1));

        return new Dimensions(preferredWidth, preferredHeight);
    }
View Full Code Here

Examples of org.apache.pivot.wtk.Dimensions

                preferredWidth += item.getPreferredWidth(-1);
                preferredHeight = Math.max(item.getPreferredHeight(-1), preferredHeight);
            }
        }

        return new Dimensions(preferredWidth, preferredHeight);
    }
View Full Code Here

Examples of org.apache.pivot.wtk.Dimensions

        }
    }

    private Component addDimensionsControl(final Dictionary<String, Object> dictionary,
        final String key, Form.Section section) {
        Dimensions dimensions = (Dimensions)dictionary.get(key);

        BoxPane boxPane = new BoxPane(Orientation.VERTICAL);
        section.add(boxPane);
        Form.setLabel(boxPane, key);

        FlowPane flowPane = new FlowPane();
        flowPane.getStyles().put("alignToBaseline", true);
        flowPane.getStyles().put("horizontalSpacing", 5);
        boxPane.add(flowPane);

        TextInput textInput = new TextInput();
        textInput.setTextSize(4);
        textInput.setMaximumLength(5);
        textInput.setValidator(new IntValidator());
        textInput.setText(String.valueOf(dimensions.width));
        flowPane.add(textInput);

        textInput.getComponentStateListeners().add(new ComponentStateListener.Adapter() {
            @Override
            public void focusedChanged(Component component, Component obverseComponent) {
                if (!component.isFocused()) {
                    TextInput textInput = (TextInput)component;
                    Dimensions dimensions = (Dimensions)dictionary.get(key);

                    try {
                        int width = Integer.parseInt(textInput.getText());
                        dictionary.put(key, new Dimensions(width, dimensions.height));
                    } catch (Exception exception) {
                        displayErrorMessage(exception, component.getWindow());
                        textInput.setText(String.valueOf(dimensions.width));
                    }
                }
            }
        });

        Label label = new Label("width");
        label.getStyles().put("font", "{italic:true}");
        flowPane.add(label);

        flowPane = new FlowPane();
        flowPane.getStyles().put("alignToBaseline", true);
        flowPane.getStyles().put("horizontalSpacing", 5);
        boxPane.add(flowPane);

        textInput = new TextInput();
        textInput.setTextSize(4);
        textInput.setMaximumLength(5);
        textInput.setValidator(new IntValidator());
        textInput.setText(String.valueOf(dimensions.height));
        flowPane.add(textInput);

        textInput.getComponentStateListeners().add(new ComponentStateListener.Adapter() {
            @Override
            public void focusedChanged(Component component, Component obverseComponent) {
                if (!component.isFocused()) {
                    TextInput textInput = (TextInput)component;
                    Dimensions dimensions = (Dimensions)dictionary.get(key);

                    try {
                        int height = Integer.parseInt(textInput.getText());
                        dictionary.put(key, new Dimensions(dimensions.width, height));
                    } catch (Exception exception) {
                        displayErrorMessage(exception, component.getWindow());
                        textInput.setText(String.valueOf(dimensions.height));
                    }
                }
View Full Code Here

Examples of org.apache.pivot.wtk.Dimensions

    private void updateDimensionsControl(Dictionary<String, Object> dictionary, String key) {
        BoxPane boxPane = (BoxPane)controls.get(key);

        if (boxPane != null) {
            Dimensions dimensions = (Dimensions)dictionary.get(key);

            TextInput widthTextInput = (TextInput)((FlowPane)boxPane.get(0)).get(0);
            TextInput heightTextInput = (TextInput)((FlowPane)boxPane.get(1)).get(0);

            widthTextInput.setText(String.valueOf(dimensions.width));
View Full Code Here

Examples of org.sbml.jsbml.ext.layout.Dimensions

          double ypos = nodeView.getYPosition();
          double zpos = 0.0;
          double height = nodeView.getHeight();
          double width = nodeView.getWidth();
          double depth = 0.0;
          Dimensions dim = new Dimensions(width, height, depth, level, version);
          Point point = new Point(xpos, ypos, zpos, level, version);
         
          BoundingBox box = new BoundingBox();
          box.setLevel(level);
          box.setVersion(version);
View Full Code Here

Examples of org.waveprotocol.wave.client.paging.FakeBlock.Dimensions

    return topChosen;
  }

  private FakeBlock create(FakeBlock.Factory with) {
    boolean isZero = random.nextDouble() < zeroProbability;
    Dimensions childSize = isZero ? Dimensions.zero() : Dimensions.create(random);
    FakeBlock child = with.create(name(), childSize);
    return child;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.