コード例 #1
0
ファイル: TextItemPanel.java プロジェクト: NomDInet/JMRI
 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();
 }
コード例 #2
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;
 }