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.
17 package com
.intellij
.uiDesigner
.designSurface
;
24 class HorzInsertFeedbackPainter
implements FeedbackPainter
{
25 public static HorzInsertFeedbackPainter INSTANCE
= new HorzInsertFeedbackPainter();
27 public void paintFeedback(Graphics2D g2d
, Rectangle rc
) {
28 g2d
.setColor(Color
.BLUE
);
29 g2d
.setStroke(new BasicStroke(1.5f
));
30 int midY
= (int)rc
.getCenterY();
31 int right
= rc
.x
+ rc
.width
- 1;
32 int bottom
= rc
.y
+ rc
.height
- 1;
33 g2d
.drawLine(rc
.x
, rc
.y
, GridInsertLocation
.INSERT_ARROW_SIZE
, midY
);
34 g2d
.drawLine(rc
.x
, bottom
, GridInsertLocation
.INSERT_ARROW_SIZE
, midY
);
35 g2d
.drawLine(GridInsertLocation
.INSERT_ARROW_SIZE
, midY
,
36 right
- GridInsertLocation
.INSERT_ARROW_SIZE
, midY
);
37 g2d
.drawLine(right
, rc
.y
,
38 rc
.x
+rc
.width
-GridInsertLocation
.INSERT_ARROW_SIZE
, midY
);
39 g2d
.drawLine(right
, bottom
,
40 right
-GridInsertLocation
.INSERT_ARROW_SIZE
, midY
);