當前位置: 首頁>>代碼示例>>Java>>正文


Java Label類代碼示例

本文整理匯總了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;
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:19,代碼來源:RoundDetailsPart.java

示例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 );
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:35,代碼來源:TextController.java

示例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();
}
 
開發者ID:andre-santos-pt,項目名稱:pandionj,代碼行數:19,代碼來源:MatrixWidget.java

示例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()));
}
 
開發者ID:andre-santos-pt,項目名稱:pandionj,代碼行數:18,代碼來源:BinaryWidget.java

示例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);
}
 
開發者ID:bsteker,項目名稱:bdf2,代碼行數:17,代碼來源:AbstractNodeFigure.java

示例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;
}
 
開發者ID:eclipse,項目名稱:gemoc-studio,代碼行數:20,代碼來源:BranchEditPart.java

示例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);
		}
	});
}
 
開發者ID:andre-santos-pt,項目名稱:pandionj,代碼行數:18,代碼來源:ObjectFigure.java

示例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;
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:13,代碼來源:RoundDetailsPart.java

示例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;
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:13,代碼來源:RoundDetailsPart.java

示例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;
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:39,代碼來源:GenericLevelPresets.java

示例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 );
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:9,代碼來源:GenericLevelPresets.java

示例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 );
    }
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:13,代碼來源:GenericLevelPresets.java

示例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;
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:14,代碼來源:AbstractBaseDraw2DDetailsPart.java

示例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);
}
 
開發者ID:andre-santos-pt,項目名稱:pandionj,代碼行數:9,代碼來源:NullFigure.java

示例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);
		}
	}
}
 
開發者ID:andre-santos-pt,項目名稱:pandionj,代碼行數:13,代碼來源:ExtensionManager.java


注:本文中的org.eclipse.draw2d.Label類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。