Esempio n. 1
0
 public Positionable finishClone(Positionable p) {
   PositionableLabel pos = (PositionableLabel) p;
   pos._text = _text;
   pos._icon = _icon;
   pos._control = _control;
   //        pos._rotateText = _rotateText;
   pos._unRotatedText = _unRotatedText;
   pos.setLocation(getX(), getY());
   pos._displayLevel = _displayLevel;
   pos._controlling = _controlling;
   pos._hidden = _hidden;
   pos._positionable = _positionable;
   pos._showTooltip = _showTooltip;
   pos.setTooltip(getTooltip());
   pos._editable = _editable;
   if (getPopupUtility() == null) {
     pos.setPopupUtility(null);
   } else {
     pos.setPopupUtility(getPopupUtility().clone(pos, pos.getTextComponent()));
   }
   pos.setOpaque(isOpaque());
   if (_namedIcon != null) {
     pos._namedIcon = cloneIcon(_namedIcon, pos);
     pos.setIcon(pos._namedIcon);
     pos.rotate(_degrees); // this will change text in icon with a new _namedIcon.
   }
   pos.updateSize();
   return pos;
 }
Esempio n. 2
0
 public Object getTransferData(DataFlavor flavor)
     throws UnsupportedFlavorException, IOException {
   if (!isDataFlavorSupported(flavor)) {
     return null;
   }
   String link = _linkName.getText().trim();
   PositionableLabel l;
   if (link.length() == 0) {
     // return this.deepClone();
     l = new PositionableLabel(getText(), _editor);
   } else {
     l = new LinkingLabel(getText(), _editor, link);
   }
   _decorator.getText(l);
   PositionablePopupUtil util = _decorator.getPositionablePopupUtil();
   l.setPopupUtility(util);
   //            l.setPopupUtility(_decorator.getPositionablePopupUtil().clone(l,
   // l.getTextComponent()));
   if (util.hasBackground()) { // unrotated
     l.setOpaque(true);
   }
   l.setLevel(this.getDisplayLevel());
   return l;
   //           return this.deepClone();
 }
Esempio n. 3
0
 public PositionableLabel(NamedIcon s, Editor editor) {
   super(s);
   _editor = editor;
   _icon = true;
   _namedIcon = s;
   debug = log.isDebugEnabled();
   if (debug) {
     log.debug("PositionableLabel ctor (icon) " + s.getName());
   }
   setPopupUtility(new PositionablePopupUtil(this, this));
 }
Esempio n. 4
0
 public PositionableLabel(String s, Editor editor) {
   super(s);
   _editor = editor;
   _text = true;
   _unRotatedText = s;
   debug = log.isDebugEnabled();
   if (debug) {
     log.debug("PositionableLabel ctor (text) " + s);
   }
   setHorizontalAlignment(JLabel.CENTER);
   setVerticalAlignment(JLabel.CENTER);
   setPopupUtility(new PositionablePopupUtil(this, this));
 }