Package ptolemy.actor.gui

Examples of ptolemy.actor.gui.SizeAttribute


        // making it persistent, when the model is saved, the
        // attribute will determine the current size and position
        // of the window and save it.
        _windowProperties.setPersistent(true);

        _plotSize = new SizeAttribute(this, "_plotSize");
        _plotSize.setPersistent(true);

        _attachText("_iconDescription", "<svg>\n"
                + "<rect x=\"-20\" y=\"-20\" " + "width=\"40\" height=\"40\" "
                + "style=\"fill:lightGrey\"/>\n" + "<rect x=\"-12\" y=\"-12\" "
View Full Code Here


        // making it persistent, when the model is saved, the
        // attribute will determine the current size and position
        // of the window and save it.
        _windowProperties.setPersistent(true);

        _pictureSize = new SizeAttribute(this, "_pictureSize");
        _pictureSize.setPersistent(true);
    }
View Full Code Here

            System.out.println("Warning: Failed to get applet width "
                    + "and height, using defaults: " + ex.getMessage());
        }

        try {
            SizeAttribute vergilSize = (SizeAttribute) _model
                    .getAttribute("_vergilSize");

            IntMatrixToken vergilSizeToken = (IntMatrixToken) vergilSize
                    .getToken();

            vergilWidth = vergilSizeToken.getElementAt(0, 0);
            vergilHeight = vergilSizeToken.getElementAt(0, 1);
        } catch (Exception ex) {
View Full Code Here

        // Get dimensions from the model, if they are present.
        // Otherwise, use the same defaults used by vergil.
        boolean boundsSet = false;

        try {
            SizeAttribute vergilBounds = (SizeAttribute) _toplevel
                    .getAttribute("_vergilSize", SizeAttribute.class);
            boundsSet = vergilBounds.setSize(modelViewer);
        } catch (Throwable throwable) {
            // Ignore and set to default.
        }

        if (!boundsSet) {
View Full Code Here

            // of the JGraph component. Unfortunately, with Swing's
            // mysterious and undocumented handling of component sizes,
            // there appears to be no way to control the size of the
            // JGraph from the size of the Frame, which is specified
            // by the WindowPropertiesAttribute.
            SizeAttribute size = (SizeAttribute) getModel().getAttribute(
                    "_vergilSize", SizeAttribute.class);

            if (size != null) {
                size.setSize(_rightComponent);
            } else {
                // Set the default size.
                // Note that the location is of the frame, while the size
                // is of the scrollpane.
                _rightComponent.setMinimumSize(new Dimension(200, 200));
View Full Code Here

            }

            // Have to also record the size of the JGraph because
            // setting the size of the frame is ignored if we don't
            // also set the size of the JGraph. Why? Who knows. Swing.
            SizeAttribute size = (SizeAttribute) getModel().getAttribute(
                    "_vergilSize", SizeAttribute.class);

            if (size == null) {
                size = new SizeAttribute(getModel(), "_vergilSize");
            }

            size.recordSize(_getRightComponent());

            // Also record zoom and pan state.
            JCanvas canvas = getJGraph().getGraphPane().getCanvas();
            AffineTransform current = canvas.getCanvasPane()
                    .getTransformContext().getTransform();
View Full Code Here

TOP

Related Classes of ptolemy.actor.gui.SizeAttribute

Copyright © 2018 www.massapicom. 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.