private void createFeedback() { if (myFeedback == null) { FeedbackLayer layer = myContext.getArea().getFeedbackLayer(); myFeedback = new RectangleFeedback(Color.blue, 2); layer.add(myFeedback); myTextFeedback = new TextFeedback(); myTextFeedback.setBorder(new LineMarginBorder(0, 5, 3, 0)); layer.add(myTextFeedback); layer.add(myWrapFeedback); layer.add(myFillFeedback); layer.repaint(); } }
@Override public void eraseFeedback() { if (myFeedback != null) { FeedbackLayer layer = myContext.getArea().getFeedbackLayer(); layer.remove(myFeedback); layer.remove(myTextFeedback); layer.remove(myWrapFeedback); layer.remove(myFillFeedback); layer.repaint(); myFeedback = null; myTextFeedback = null; myWrapFeedback = null; myFillFeedback = null; } }