本文整理匯總了Java中org.eclipse.draw2d.Label類的典型用法代碼示例。如果您正苦於以下問題:Java Label類的具體用法?Java Label怎麽用?Java Label使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
Label類屬於org.eclipse.draw2d包,在下文中一共展示了Label類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: createRoundArrow
import org.eclipse.draw2d.Label; //導入依賴的package包/類
private void createRoundArrow ( final Figure figure )
{
final PolylineConnection c = new PolylineConnection ();
c.setSourceAnchor ( new ChopboxAnchor ( this.sourceRect ) );
c.setTargetAnchor ( new ChopboxAnchor ( this.targetRect ) );
final PolygonDecoration dec = new PolygonDecoration ();
dec.setTemplate ( PolygonDecoration.TRIANGLE_TIP );
c.setTargetDecoration ( dec );
final MidpointLocator typeLocator = new MidpointLocator ( c, 0 );
typeLocator.setRelativePosition ( PositionConstants.NORTH );
this.typeLabel = new Label ( "" ); //$NON-NLS-1$
c.add ( this.typeLabel, typeLocator );
figure.add ( c );
this.roundConnection = c;
}
示例2: TextController
import org.eclipse.draw2d.Label; //導入依賴的package包/類
public TextController ( final FigureCanvas canvas, final SymbolController controller, final Text element, final ResourceManager manager )
{
super ( controller, manager );
this.canvas = canvas;
this.figure = new Label ( element.getText ()) {
@Override
public void addNotify ()
{
super.addNotify ();
start ();
}
@Override
protected void paintFigure ( final Graphics graphics )
{
final Double alpha = getAlpha ();
if ( alpha != null )
{
graphics.setAlpha ( (int) ( Math.max ( 0.0, Math.min ( 1.0, alpha ) ) * 255.0 ) );
}
super.paintFigure ( graphics );
}
@Override
public void removeNotify ()
{
stop ();
super.removeNotify ( );
}
};
controller.addElement ( element, this );
applyCommon ( element );
}
示例3: update
import org.eclipse.draw2d.Label; //導入依賴的package包/類
private void update() {
removeAll();
valid = model.isMatrix();
if(valid) {
Object[] array = (Object[]) model.getValues();
for(Object line : array) {
int len = Array.getLength(line);
for(int i = 0; i < len; i++) {
Object e = Array.get(line, i);
Label label = new Label(e.toString()); // TODO array deepToString
label.setForegroundColor(ColorConstants.black);
add(label);
}
}
}
getLayoutManager().layout(this);
repaint();
}
示例4: update
import org.eclipse.draw2d.Label; //導入依賴的package包/類
private void update(IValueModel v, int value) {
long n = Long.parseLong(v.getCurrentValue());
int nBits = 0;
String bits = Long.toBinaryString(n);
switch(v.getTypeName()) {
case "byte": nBits = 8; break;
case "short": nBits = 16; break;
case "int": nBits = 32; break;
case "long": nBits = 64; break;
}
while(bits.length() < nBits)
bits = "0" + bits;
label.setText(bits);
label.setToolTip(new Label(v.getCurrentValue()));
}
示例5: AbstractNodeFigure
import org.eclipse.draw2d.Label; //導入依賴的package包/類
public AbstractNodeFigure(AbstractNodeElement node,Image icon){
this.node=node;
BorderLayout layout=new BorderLayout();
this.setLayoutManager(layout);
ImageFigure iconFigure=new ImageFigure(icon);
this.add(iconFigure,BorderLayout.LEFT);
this.label=new Label(this.node.getLabel());
this.label.setForegroundColor(ColorConstants.black);
this.add(this.label,BorderLayout.CENTER);
this.setAntialias(SWT.ON);
RGB rgb=Activator.getPreference().getBorderColor();
this.setForegroundColor(new Color(null,rgb.red,rgb.green,rgb.blue));
rgb=Activator.getPreference().getBackgroundColor();
this.setBackgroundColor(new Color(null,rgb.red,rgb.green,rgb.blue));
this.setLineWidth(2);
}
示例6: createFigure
import org.eclipse.draw2d.Label; //導入依賴的package包/類
@Override
protected IFigure createFigure() {
final LineLayout layout = new LineLayout();
layout.setHorizontal(true);
layout.setMajorAlignment(FlowLayout.ALIGN_TOPLEFT);
layout.setMinorAlignment(FlowLayout.ALIGN_BOTTOMRIGHT);
layout.setMinorSpacing(SPACING);
layout.setMargin(MARGIN);
FreeformLayer res = new FreeformLayer();
final Label toolTip = new Label();
toolTip.setFont(JFaceResources.getFont(JFaceResources.TEXT_FONT));
toolTip.setBackgroundColor(ColorConstants.tooltipBackground);
toolTip.setForegroundColor(ColorConstants.tooltipForeground);
toolTip.setText(getModel().getTimelineWindow().getProvider().getTextAt(getModel().getBranch()));
res.setToolTip(toolTip);
res.setLayoutManager(layout);
return res;
}
示例7: MethodWidget
import org.eclipse.draw2d.Label; //導入依賴的package包/類
MethodWidget(IMethod method) {
setLayoutManager(new FlowLayout());
button = new Button(shortSig(method));
button.setToolTip(new Label(longSig(method)));
button.setForegroundColor(ColorConstants.black);
FontManager.setFont(button, PandionJConstants.BUTTON_FONT_SIZE);
button.setEnabled(methodsEnabled);
add(button);
resultLabel = new Label();
resultLabel.setForegroundColor(ColorConstants.black);
add(resultLabel);
button.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent event) {
invoke(model, method, resultLabel);
}
});
}
示例8: createTargetValue
import org.eclipse.draw2d.Label; //導入依賴的package包/類
private IFigure createTargetValue ()
{
this.targetRect = new RoundedRectangle ();
this.targetRect.setLayoutManager ( new BorderLayout () );
this.targetRect.setBackgroundColor ( ColorConstants.lightGray );
this.targetRect.setForegroundColor ( ColorConstants.black );
this.targetRect.setBorder ( new MarginBorder ( 10 ) );
this.targetRect.add ( this.targetLabel = new Label (), BorderLayout.CENTER );
return this.targetRect;
}
示例9: createSourceValue
import org.eclipse.draw2d.Label; //導入依賴的package包/類
private IFigure createSourceValue ()
{
this.sourceRect = new RoundedRectangle ();
this.sourceRect.setLayoutManager ( new BorderLayout () );
this.sourceRect.setBackgroundColor ( ColorConstants.lightGray );
this.sourceRect.setForegroundColor ( ColorConstants.black );
this.sourceRect.setBorder ( new MarginBorder ( 10 ) );
this.sourceRect.add ( this.sourceLabel = new Label (), BorderLayout.CENTER );
return this.sourceRect;
}
示例10: createEntryGrid
import org.eclipse.draw2d.Label; //導入依賴的package包/類
private IFigure createEntryGrid ( final Figure connLayer )
{
final Figure figure = new Figure ();
figure.setLayoutManager ( new GridLayout ( 1, false ) );
figure.add ( this.presetCeil = new Label ( "" ), new GridData ( GridData.CENTER, GridData.FILL, true, true ) ); //$NON-NLS-1$
figure.add ( this.presetHH = new Label ( "" ), new GridData ( GridData.CENTER, GridData.FILL, true, true ) ); //$NON-NLS-1$
figure.add ( this.presetH = new Label ( "" ), new GridData ( GridData.CENTER, GridData.FILL, true, true ) ); //$NON-NLS-1$
figure.add ( this.currentLabel = new Label ( "" ), new GridData ( GridData.CENTER, GridData.FILL, true, true ) ); //$NON-NLS-1$
figure.add ( this.presetL = new Label ( "" ), new GridData ( GridData.CENTER, GridData.FILL, true, true ) ); //$NON-NLS-1$
figure.add ( this.presetLL = new Label ( "" ), new GridData ( GridData.CENTER, GridData.FILL, true, true ) ); //$NON-NLS-1$
figure.add ( this.presetFloor = new Label ( "" ), new GridData ( GridData.CENTER, GridData.FILL, true, true ) ); //$NON-NLS-1$
createConnection ( connLayer, this.presetCeil, this.rectCeil );
createConnection ( connLayer, this.presetHH, this.triHH );
createConnection ( connLayer, this.presetH, this.triH );
createConnection ( connLayer, this.presetL, this.triL );
createConnection ( connLayer, this.presetLL, this.triLL );
createConnection ( connLayer, this.presetFloor, this.rectFloor );
this.blinkerCeil = new LevelBlinker ( this.rectCeil );
this.blinkerHH = new LevelBlinker ( this.triHH );
this.blinkerH = new LevelBlinker ( this.triH );
this.blinkerL = new LevelBlinker ( this.triL );
this.blinkerLL = new LevelBlinker ( this.triLL );
this.blinkerFloor = new LevelBlinker ( this.rectFloor );
this.stylerCeil = new StateStyler ( this.blinkerCeil );
this.stylerHH = new StateStyler ( this.blinkerHH );
this.stylerH = new StateStyler ( this.blinkerH );
this.stylerL = new StateStyler ( this.blinkerL );
this.stylerLL = new StateStyler ( this.blinkerLL );
this.stylerFloor = new StateStyler ( this.blinkerFloor );
return figure;
}
示例11: createConnection
import org.eclipse.draw2d.Label; //導入依賴的package包/類
private void createConnection ( final Figure connLayer, final Label label, final Figure figure )
{
final Connection c = new PolylineConnection ();
c.setSourceAnchor ( new ChopboxAnchor ( label ) );
c.setTargetAnchor ( new ChopboxAnchor ( figure ) );
c.setConnectionRouter ( new BendpointConnectionRouter () );
connLayer.add ( c );
}
示例12: setLabel
import org.eclipse.draw2d.Label; //導入依賴的package包/類
private void setLabel ( final Label preset, final String string )
{
final Number num = getPreset ( string );
if ( num != null )
{
preset.setText ( String.format ( Messages.LevelPresets_NumFormat, num.toString () ) );
}
else
{
preset.setText ( Messages.LevelPresets_EmtyNum );
}
}
示例13: createNaPanel
import org.eclipse.draw2d.Label; //導入依賴的package包/類
private IFigure createNaPanel ()
{
final Figure naPanel = new Figure ();
final BorderLayout layout = new BorderLayout ();
naPanel.setLayoutManager ( layout );
final Label label = new Label ();
label.setText ( Messages.AbstractBaseDraw2DDetailsPart_Label_NotAvail_Text );
naPanel.add ( label, BorderLayout.CENTER );
return naPanel;
}
示例14: NullFigure
import org.eclipse.draw2d.Label; //導入依賴的package包/類
public NullFigure(IEntityModel model) {
super(model);
Label label = new Label(" ");
label.setOpaque(false);
label.setSize(-1,-1);
label.setToolTip(new Label("null"));
add(label);
}
示例15: addChildFigures
import org.eclipse.draw2d.Label; //導入依賴的package包/類
private void addChildFigures(IObjectModel m, String attName) {
IArrayModel<?> array = m.getArray(attName);
if(array != null) {
IArrayWidgetExtension ext = getArrayExtension(array, tags.get(attName));
if(ext != IArrayWidgetExtension.NULL_EXTENSION) {
IFigure f = ext.createFigure(array);
f.setToolTip(new Label(attName));
figs.put(attName, f);
compositeFig.add(f);
}
}
}