Java Rectangle Bounds encodeBounds(Rectangle rBounds)

Here you can find the source of encodeBounds(Rectangle rBounds)

Description

* Encode the bounds of a component into a comma separated list * that is appropriate for storing in a Properties object.

License

Open Source License

Parameter

Parameter Description
rBounds a parameter

Return

the encoded bounds

Declaration

public static String encodeBounds(Rectangle rBounds) 

Method Source Code

//package com.java2s;
/*******************************************************************************
 * Copyright (c) 2006 Sybase, Inc. and others.
 *
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:// w  w w. j a v a 2 s.  c  o  m
 *     Sybase, Inc. - initial API and implementation
 *******************************************************************************/

import java.awt.Rectangle;

public class Main {
    /**
     * * Encode the bounds of a component into a comma separated list * that is
     * appropriate for storing in a Properties object. * See decodeBounds();
     * @param rBounds 
     * @return the encoded bounds
     */
    public static String encodeBounds(Rectangle rBounds) {
        return "" + rBounds.x + "," + rBounds.y + "," + rBounds.width + "," //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
                + rBounds.height;
    }
}

Related

  1. exportBounds(Frame theFame, Document doc)
  2. getBounds(Shape s)
  3. getBoundsInAncestor(Container ancestor, final Component comp, Rectangle bounds)
  4. getCenteredBoundsOn(Rectangle srcBounds, int width, int height)