update copyright
[fedora-idea.git] / plugins / ui-designer / src / com / intellij / uiDesigner / propertyInspector / renderers / RectangleRenderer.java
blobfe9e8998e5f66013fce77904cae7133c2cbc98f7
1 /*
2 * Copyright 2000-2009 JetBrains s.r.o.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
16 package com.intellij.uiDesigner.propertyInspector.renderers;
18 import java.awt.*;
20 /**
21 * @author Anton Katilin
22 * @author Vladimir Kondratyev
24 public final class RectangleRenderer extends LabelPropertyRenderer<Rectangle> {
25 private final StringBuffer myBuffer;
27 public RectangleRenderer(){
28 myBuffer=new StringBuffer();
31 protected void customize(final Rectangle value){
32 myBuffer.setLength(0);
33 myBuffer.append('[').append(value.x).append(", ");
34 myBuffer.append(value.y).append(", ");
35 myBuffer.append(value.width).append(", ");
36 myBuffer.append(value.height).append("]");
38 setText(myBuffer.substring(0, myBuffer.length())); // [jeka] important! do not use toString() on the StringBuffer that is reused