本文整理汇总了Java中org.eclipse.swt.SWT.NO_BACKGROUND属性的典型用法代码示例。如果您正苦于以下问题:Java SWT.NO_BACKGROUND属性的具体用法?Java SWT.NO_BACKGROUND怎么用?Java SWT.NO_BACKGROUND使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.eclipse.swt.SWT
的用法示例。
在下文中一共展示了SWT.NO_BACKGROUND属性的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createPieceDistPanel
private void createPieceDistPanel() {
comp.setLayout(new FillLayout());
//pieceDistComposite = new Composite(parent, SWT.NONE);
pieceDistCanvas = new Canvas(comp,SWT.NO_BACKGROUND);
pieceDistCanvas.addListener(SWT.Paint, new Listener() {
@Override
public void handleEvent(Event event) {
if ( pem==null || pem.isDestroyed()){
event.gc.fillRectangle(event.x, event.y, event.width, event.height);
}else{
if (imgToPaint != null && !imgToPaint.isDisposed()) {
event.gc.drawImage(imgToPaint, 0, 0);
}
}
}
});
}
示例2: AnimatedImage
public AnimatedImage(Composite parent) {
canvas = new Canvas(parent,SWT.NO_BACKGROUND);
Color background = null;
Composite p = parent;
while(p != null && background == null) {
background = p.getBackground();
if(background != null) {
//System.out.println("background : " + background + ", composite : " + p);
break;
}
p = p.getParent();
}
canvas.setBackground(background);
canvas.addListener(SWT.Dispose, new Listener() {
@Override
public void handleEvent(Event event) {
stop();
disposeImages();
}
});
}
示例3: createGraphComposite
private void createGraphComposite(Composite parent) {
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (ClassNotFoundException | InstantiationException | IllegalAccessException
| UnsupportedLookAndFeelException e) {
e.printStackTrace();
}
Composite composite = new Composite(parent, SWT.EMBEDDED | SWT.NO_BACKGROUND);
ClassLoader loader = CFGView.class.getClassLoader();
URL stylesheetUrl = loader.getResource("/styles/styleSheet.css");
System.setProperty("sun.awt.noerasebackground", "true");
System.setProperty("org.graphstream.ui.renderer", "org.graphstream.ui.j2dviewer.J2DGraphRenderer");
GraphManager manager = new GraphManager("VisuFlow Graph", "url('"+stylesheetUrl.toString()+"')");
Thread t = new Thread(manager);
t.start();
Frame frame = SWT_AWT.new_Frame(composite);
frame.add(manager.getApplet());
frame.pack();
}
示例4: initialize
public void initialize(Composite composite, int defaultOrientation) {
display = composite.getDisplay();
composite.addDisposeListener((DisposeListener) this::dispose);
tableViewer = new TableViewer(composite, SWT.MULTI | SWT.FULL_SELECTION | SWT.VIRTUAL | SWT.NO_BACKGROUND | SWT.DOUBLE_BUFFERED );
table = tableViewer.getTable();
GridData gridData = new GridData();
gridData.verticalAlignment = GridData.FILL;
gridData.horizontalSpan = 2;
gridData.grabExcessHorizontalSpace = true;
gridData.grabExcessVerticalSpace = true;
gridData.horizontalAlignment = GridData.FILL;
tableViewer.getControl().setLayoutData(gridData);
tableViewer.setContentProvider((ILazyContentProvider) rowIndex -> tableViewer.replace(contentProvider().getTableEntries().get(rowIndex), rowIndex));
table.addListener(SWT.Selection, event-> {
TableItem item = (TableItem) event.item;
contentProvider().setCursorIndex(contentProvider().getRowIndex((RankedItem<T>) item.getData()));
handleSelection();
});
composite.getShell().addListener(SWT.Resize, event -> autoAdjustColumnWidths(composite));
// TODO try throttleLast or custom scheduler
//subjectFilter.debounce(0, TimeUnit.MILLISECONDS).subscribe( filter -> handleRefresh(filter));
}
示例5: KaviPickListDialog
public KaviPickListDialog() {
super(ProgressManagerUtil.getDefaultParent(), SWT.RESIZE | SWT.NO_BACKGROUND, true, true, false, true, true, null, "Central Command");
kaviList = new KaviList<T>(KaviPickListDialog.this);
kaviList.setListContentChangedAction((list, selections) -> {
displayInfo.filteredCount = list.size();
displayInfo.selectedCount = selections.size();
displayInfo.mode = kaviList.currentContentMode();
updateInfoDisplay();
});
create();
}
示例6: OldFXCanvas
/**
* @inheritDoc
*/
public OldFXCanvas(@NamedArg("parent") Composite parent, @NamedArg("style") int style) {
super(parent, style | SWT.NO_BACKGROUND);
initFx();
hostContainer = new HostContainer();
registerEventListeners();
Display display = parent.getDisplay();
display.addFilter(SWT.Move, moveFilter);
}
示例7: ImageCanvas
/**
* Constructor for ImageCanvas.
*/
public ImageCanvas(Composite parent, int style, Image image, Object layoutData) {
super(parent, style | SWT.SHELL_TRIM | SWT.NO_BACKGROUND | SWT.NO_REDRAW_RESIZE);
this.image = image;
setLayoutData(layoutData);
setSize(image.getImageData().width, image.getImageData().height);
addPaintListener(this);
}
示例8: createPartControl
@Override
public void createPartControl(final Composite parent) {
Visualization.container = new Composite(parent, SWT.EMBEDDED | SWT.NO_BACKGROUND);
Visualization.frame = null;
Visualization.f = null;
Visualization.graph = null;
Visualization.myState = null;
Visualization.evaluatorPanel = EvaluatorPanel.getInstance(Visualization.xmlFileName);
Visualization.showViz();
Visualization.createPopupMenu();
}
示例9: SWTSkinObjectBrowser
/**
* @param skin
* @param properties
* @param sID
* @param sConfigID
* @param parent
*/
public SWTSkinObjectBrowser(SWTSkin skin, SWTSkinProperties properties,
String sID, String sConfigID, SWTSkinObject parent) {
super(skin, properties, sID, sConfigID, "browser", parent);
cParent = parent == null ? skin.getShell()
: (Composite) parent.getControl();
cArea = cParent;
cArea = new Canvas(cParent, SWT.NO_BACKGROUND);
cArea.setLayout(new FormLayout());
setControl(cArea);
if (cParent.isVisible()) {
init();
} else {
addListener(new SWTSkinObjectListener() {
@Override
public Object eventOccured(SWTSkinObject skinObject, int eventType,
Object params) {
if (eventType == EVENT_SHOW) {
removeListener(this);
init();
}
return null;
}
});
}
}
示例10: C8oBrowser
public C8oBrowser(Composite parent, int style) {
super(parent, style | SWT.EMBEDDED | SWT.NO_BACKGROUND);
init(parent, BrowserContext.defaultContext());
}
示例11: KTable
/**
* Creates a new KTable.
*
* possible styles: SWT.V_SCROLL - show vertical scrollbar and allow
* vertical scrolling by arrow keys SWT.H_SCROLL - show horizontal scrollbar
* and allow horizontal scrolling by arrow keys SWT.FLAT - no border
* drawing.
*
* After creation a table model should be added using setModel().
*/
public KTable(Composite parent, int style) {
// Oberklasse initialisieren
super(parent, SWT.NO_BACKGROUND | SWT.NO_REDRAW_RESIZE | style);
// inits
m_GC = new GC(this);
m_Display = Display.getCurrent();
m_Selection = new HashMap<Object, Object>();
m_CellEditor = null;
flatStyleSpecified = ((style | SWT.FLAT) == style);
m_RowSelectionMode = false;
m_MultiSelectMode = false;
m_TopRow = 0;
m_LeftColumn = 0;
m_FocusRow = 0;
m_FocusCol = 0;
m_RowsVisible = 0;
m_RowsFullyVisible = 0;
m_ColumnsVisible = 0;
m_ColumnsFullyVisible = 0;
m_ResizeColumnIndex = -1;
m_ResizeRowIndex = -1;
m_ResizeRowTop = -1;
m_NewRowSize = -1;
m_ResizeColumnLeft = -1;
m_Capture = false;
m_ClickColumnIndex = -1;
m_ClickRowIndex = -1;
m_LineRestore = null;
m_LineX = 0;
m_LineY = 0;
cellSelectionListeners = new ArrayList<KTableCellSelectionListener>(10);
cellResizeListeners = new ArrayList<KTableCellResizeListener>(10);
// Listener
createListeners();
}
示例12: XYZDisplayComp
public XYZDisplayComp(Composite parent, int style){
super(parent, style);
this.setLayout(new RowLayout(SWT.HORIZONTAL));
this.setBackground(AvoColors.COLOR_QSET_BG);
FontData fd = new FontData();
fd.setHeight(10);
fd.setStyle(SWT.BOLD);
fd.setName("Verdana");
Font f = new Font(this.getDisplay(), fd);
Label llx = new Label(this, SWT.NO_BACKGROUND);
llx.setFont(f);
llx.setText("X:");
llx.setBackground(AvoColors.COLOR_QSET_BG);
lX = new Label(this, SWT.NONE);
lX.setAlignment(SWT.RIGHT);
lX.setFont(f);
lX.setBackground(AvoColors.COLOR_QSET_BG);
Label lly = new Label(this, SWT.NONE);
lly.setFont(f);
lly.setText(" Y:");
lly.setBackground(AvoColors.COLOR_QSET_BG);
lY = new Label(this, SWT.NONE);
lY.setAlignment(SWT.RIGHT);
lY.setFont(f);
lY.setBackground(AvoColors.COLOR_QSET_BG);
Label llz = new Label(this, SWT.NONE);
llz.setFont(f);
llz.setText(" Z:");
llz.setBackground(AvoColors.COLOR_QSET_BG);
lZ = new Label(this, SWT.NONE);
lZ.setAlignment(SWT.RIGHT);
lZ.setFont(f);
lZ.setBackground(AvoColors.COLOR_QSET_BG);
updateXYZ();
AvoGlobal.glViewEventHandler.addGLViewListener(new GLViewListener(){
@Override
public void cursorMoved() {
updateXYZ();
}
});
}
示例13: initialize
private void initialize(Composite parent) {
blockColors = new Color[] {
properties.getColor("color.pieceview.alldone"),
properties.getColor("color.pieceview.notdone"),
properties.getColor("color.pieceview.uploading"),
properties.getColor("color.pieceview.downloading"),
properties.getColor("color.pieceview.noavail"),
properties.getColor("color.pieceview.havesome"),
};
compFindPEPiece = new Comparator() {
@Override
public int compare(Object arg0, Object arg1) {
int arg0no = (arg0 instanceof PEPiece)
? ((PEPiece) arg0).getPieceNumber() : ((Long) arg0).intValue();
int arg1no = (arg1 instanceof PEPiece)
? ((PEPiece) arg1).getPieceNumber() : ((Long) arg1).intValue();
return arg0no - arg1no;
}
};
canvas = new Canvas(parent, SWT.NO_BACKGROUND);
canvas.setLayout(new FillLayout());
canvas.addPaintListener(new PaintListener() {
@Override
public void paintControl(PaintEvent e) {
if (img != null && !img.isDisposed()) {
Rectangle bounds = img.getBounds();
if (bounds.width >= e.width && bounds.height >= e.height) {
e.gc.drawImage(img, e.x, e.y, e.width, e.height, e.x, e.y, e.width,
e.height);
}
} else {
e.gc.fillRectangle(e.x, e.y, e.width, e.height);
}
}
});
canvas.addListener(SWT.Resize, new Listener() {
@Override
public void handleEvent(Event event) {
calcBlockSize();
}
});
}