01: /*
02: * Copyright 2005 Patrick Gotthardt
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
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.
15: */
16: package com.pagosoft.plaf;
17:
18: import javax.swing.*;
19: import javax.swing.plaf.*;
20: import javax.swing.plaf.basic.*;
21: import java.awt.*;
22: import java.beans.PropertyChangeEvent;
23:
24: public class PgsEditorPaneUI extends BasicEditorPaneUI {
25: public static ComponentUI createUI(JComponent c) {
26: return new PgsEditorPaneUI();
27: }
28:
29: public final void paintSafely(Graphics g) {
30: PgsUtils.installAntialiasing(g);
31: super .paintSafely(g);
32: PgsUtils.uninstallAntialiasing(g);
33: }
34:
35: protected void propertyChange(PropertyChangeEvent evt) {
36: super .propertyChange(evt);
37:
38: if (PlafOptions.isHtmlDisplayFixEnabled()
39: && "editorKit".equals(evt.getPropertyName())) {
40: PgsUtils.fixHtmlDisplay(getComponent());
41: }
42: }
43:
44: protected void uninstallListeners() {
45: super .uninstallListeners();
46:
47: getComponent().removeMouseListener(
48: TextComponentPopupHandler.getInstance());
49: }
50:
51: protected void installListeners() {
52: super.installListeners();
53:
54: getComponent().addMouseListener(
55: TextComponentPopupHandler.getInstance());
56: }
57: }
|