本文整理汇总了Java中org.eclipse.wb.swt.SWTResourceManager类的典型用法代码示例。如果您正苦于以下问题:Java SWTResourceManager类的具体用法?Java SWTResourceManager怎么用?Java SWTResourceManager使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SWTResourceManager类属于org.eclipse.wb.swt包,在下文中一共展示了SWTResourceManager类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: HowToSubcircuit
import org.eclipse.wb.swt.SWTResourceManager; //导入依赖的package包/类
/**
* Create the shell.
*
* @param display
*/
public HowToSubcircuit(Display display) {
super(display, SWT.SHELL_TRIM);
Label lblMemristorTool = new Label(this, SWT.NONE);
lblMemristorTool.setFont(SWTResourceManager.getFont("Ubuntu", 12,
SWT.BOLD));
lblMemristorTool.setBounds(10, 10, 500, 24);
lblMemristorTool.setText("How to export a memristor model to Spice or Spectre?");
Label lblDeveloperFernandoGarca = new Label(this, SWT.NONE);
lblDeveloperFernandoGarca.setBounds(10, 40, 542, 204);
lblDeveloperFernandoGarca
.setText("Once the simulation has been computed, we can export the corresponding\n subcircuit file.\nThis file can be referenced by including the subcircuit path in the\nschematic file, like\n\ninclude \"path /subcircuitFile.scs\"\n\nDoing this we can use several instances of our component.\nFor example, in SPICE:\n\"memristor1 port1 port2 memristor\"");
createContents();
}
示例2: About
import org.eclipse.wb.swt.SWTResourceManager; //导入依赖的package包/类
/**
* Create the shell.
*
* @param display
*/
public About(Display display) {
super(display, SWT.SHELL_TRIM);
setImage(SWTResourceManager.getImage(About.class, "/resources/memristor.png"));
Label lblMemristorTool = new Label(this, SWT.NONE);
lblMemristorTool.setFont(SWTResourceManager.getFont("Ubuntu", 12,
SWT.BOLD));
lblMemristorTool.setBounds(124, 27, 314, 40);
lblMemristorTool.setText(ResourcesAndUsefulFunctions.APPTITLE);
Label lblNewLabel = new Label(this, SWT.NONE);
//lblNewLabel.setImage(SWTResourceManager.getImage(MAF.class, "/resources/memristor.png"));
lblNewLabel.setImage(SWTResourceManager.getImage(Label.class, "/resources/memristor.png"));
lblNewLabel.setBounds(26, 10, 92, 58);
Label lblVersion = new Label(this, SWT.NONE);
lblVersion.setBounds(87, 102, 92, 16);
lblVersion.setText("Version: "+ ResourcesAndUsefulFunctions.APPVERSION);
Label lblDeveloperFernandoGarca = new Label(this, SWT.NONE);
lblDeveloperFernandoGarca.setBounds(87, 127, 335, 23);
lblDeveloperFernandoGarca
.setText("Developer: Fernando García, [email protected]");
createContents();
}
示例3: createContents
import org.eclipse.wb.swt.SWTResourceManager; //导入依赖的package包/类
/**
* Create contents of the shell.
*/
protected void createContents() {
setText("SWT Application");
setSize(673, 173);
windowLocation.showWindowOnScreenCenter(this);
addPaintListener(new PaintListener() {
@Override
public void paintControl(PaintEvent e) {
// TODO Auto-generated method stub
e.gc.setForeground(SWTResourceManager.getColor(SWT.COLOR_WHITE));
e.gc.drawString(infotext, 20, getSize().y-20,true);
}
});
}
示例4: getBMessageBox
import org.eclipse.wb.swt.SWTResourceManager; //导入依赖的package包/类
public void getBMessageBox(String title, String text, int fontstyle, int fontsize) {
bMessageBox bmb = new bMessageBox(b, SWT.None, false) {
/**
*
*/
private static final long serialVersionUID = 1L;
@Override
public void saveAction() {
// TODO Auto-generated method stub
}
};
bmb.setTitle(title);
bmb.setText(text);
Font font = SWTResourceManager.getFont(bmb.text.getFont().getFontData()[0].getName(), fontsize, fontstyle);
bmb.text.setFont(font);
bmb.open();
}
示例5: showFindResult
import org.eclipse.wb.swt.SWTResourceManager; //导入依赖的package包/类
public void showFindResult(TreeItem ti) {
if (ti != null) {
File f = (File) ti.getData("file");
if (f != null) {
openFile(f, false);
ArrayList<IRegion> al = (ArrayList<IRegion>) ti.getData("iregions");
if (al != null) {
Iterator<IRegion> it = al.iterator();
while (it.hasNext()) {
IRegion ir = it.next();
b.blackTextArea.styles = new ArrayList<StyleRange[]>();
StyleRange sr = new StyleRange(ir.getOffset(), ir.getLength(), b.color_textBackground,
org.eclipse.wb.swt.SWTResourceManager.getColor(SWT.COLOR_DARK_GREEN));
StyleRange[] s = b.getEditer().getStyleRanges(ir.getOffset(), ir.getLength());
if (s != null)
b.blackTextArea.styles.add(s);
b.getEditer().setStyleRange(sr);
}
}
}
}
}
示例6: showUpdateinof
import org.eclipse.wb.swt.SWTResourceManager; //导入依赖的package包/类
public void showUpdateinof() {
bMessageBox bme = new bMessageBox(b, SWT.NONE, false) {
/**
*
*/
private static final long serialVersionUID = 1L;
@Override
public void saveAction() {
// TODO Auto-generated method stub
}
};
bme.setTextFontinfo(12, SWT.None);
bme.setText(b.updateinfo);
bme.setTitle("���°汾");
// bme.text.setLineAlignment(0, 1, SWT.CENTER);
StyleRange sr = new StyleRange();
sr.start = 1;
sr.length = bme.text.getLine(1).length();
sr.font = SWTResourceManager.getFont("����", 20, SWT.NONE, false, true);
bme.text.setStyleRange(sr);
// bme.text.set
bme.open();
}
示例7: showMark
import org.eclipse.wb.swt.SWTResourceManager; //导入依赖的package包/类
public void showMark() {
int lineindex = st.getLineAtOffset(st.getCaretOffset());
int lineoffset = st.getOffsetAtLine(lineindex);
List<TextRegion> lis = new cheakDocument().splitString(st.getLine(st.getLineAtOffset(st.getCaretOffset())), ' ',
false, null);
Iterator<TextRegion> it = lis.iterator();
StyleRange sr = new StyleRange();
while (it.hasNext()) {
TextRegion tr = it.next();
sr.background = SWTResourceManager.getColor(SWT.COLOR_GREEN);
sr.start = tr.start + lineoffset;
sr.length = tr.end - tr.start;
st.setStyleRange(sr);
}
}
示例8: getHpAndExpGaugeImage
import org.eclipse.wb.swt.SWTResourceManager; //导入依赖的package包/类
/**
* HPゲージのイメージを取得します
*
* @param hpratio HP割合
* @param expraito 経験値割合
* @param width 幅
* @param height 高さ
* @param expHeight 経験値ゲージの高さ
* @param emptyColor 大破色
* @param halfColor 中波色
* @param fullColor 健在色
* @param expColor 経験値色
* @return HPゲージのイメージ
*/
public static Image getHpAndExpGaugeImage(float hpratio, float expraito,
int width, int height, int expHeight,
RGB emptyColor, RGB halfColor, RGB fullColor, RGB expColor) {
Image image = new Image(Display.getDefault(), width, height);
GC gc = new GC(image);
gc.setBackground(SWTResourceManager.getColor(SWT.COLOR_WHITE));
gc.fillRectangle(0, 0, width, height);
gc.setBackground(SWTResourceManager.getColor(gradation(hpratio, emptyColor, halfColor, fullColor)));
gc.fillRectangle(0, 0, (int) (width * hpratio), height);
gc.setBackground(SWTResourceManager.getColor(expColor));
gc.fillRectangle(0, height - expHeight, (int) (width * expraito), expHeight);
gc.drawImage(image, 0, 0);
gc.dispose();
return image;
}
示例9: addTable
import org.eclipse.wb.swt.SWTResourceManager; //导入依赖的package包/类
/**
* テーブルを追加します
*
* @param parent テーブルの親コンポジット
* @return TableWrapper
*/
protected TableWrapper<T> addTable(Composite parent) {
// テーブル
Table table = new Table(parent, SWT.FULL_SELECTION | SWT.MULTI);
table.setLinesVisible(true);
table.setHeaderVisible(true);
table.addKeyListener(new TableKeyShortcutAdapter(table));
// テーブル右クリックメニュー
Menu tablemenu = new Menu(table);
table.setMenu(tablemenu);
MenuItem sendclipbord = new MenuItem(tablemenu, SWT.NONE);
sendclipbord.addSelectionListener(new TableToClipboardAdapter(table));
sendclipbord.setText("クリップボードにコピー(&C)");
MenuItem reloadtable = new MenuItem(tablemenu, SWT.NONE);
reloadtable.setText("再読み込み(&R)");
reloadtable.addSelectionListener(new TableReloadAdapter());
TableWrapper<T> wrapper = new TableWrapper<T>(table, this.clazz)
.setDialogClass(this.getClass())
.setDecorator(TableItemDecorator.stripe(SWTResourceManager.getColor(AppConstants.ROW_BACKGROUND)));
this.tables.add(wrapper);
return wrapper;
}
示例10: updateTabIcon
import org.eclipse.wb.swt.SWTResourceManager; //导入依赖的package包/类
/**
* 艦隊タブのアイコンを更新します
*/
private void updateTabIcon() {
if (this.state.get(FATAL)) {
this.tab.setImage(SWTResourceManager.getImage(FleetComposite.class,
AppConfig.get().isMonoIcon()
? AppConstants.R_ICON_EXCLAMATION_MONO
: AppConstants.R_ICON_EXCLAMATION));
} else if (this.state.get(WARN)) {
this.tab.setImage(SWTResourceManager.getImage(FleetComposite.class,
AppConfig.get().isMonoIcon()
? AppConstants.R_ICON_ERROR_MONO
: AppConstants.R_ICON_ERROR));
} else {
this.tab.setImage(null);
}
}
示例11: run
import org.eclipse.wb.swt.SWTResourceManager; //导入依赖的package包/类
@Override
public void run() {
try {
// リソースを開放する
SWTResourceManager.dispose();
// 設定を書き込みます
AppConfig.store();
ShipConfig.store();
ShipGroupConfig.store();
ItemMasterConfig.store();
ItemConfig.store();
} catch (Exception e) {
LoggerHolder.LOG.fatal("シャットダウンスレッドで異常終了しました", e);
}
}
示例12: updateColoursHelper
import org.eclipse.wb.swt.SWTResourceManager; //导入依赖的package包/类
private void updateColoursHelper(TreeItem ti) {
org.eclipse.swt.widgets.TreeItem key = ti.getParent().getMapInv().get(ti);
if (key != null && ti.getData() != null && ((Object[]) ti.getData()).length == 2) {
Object[] colourObj = (Object[]) ti.getData();
ColourType type = (ColourType) colourObj[0];
switch (type) {
case OPENGL_COLOUR:
key.setBackground(1, SWTResourceManager.getColor(
(int) (255f * ((float[])((Object[]) colourObj[1])[0])[0]),
(int) (255f * ((float[])((Object[]) colourObj[1])[1])[0]),
(int) (255f * ((float[])((Object[]) colourObj[1])[2])[0])));
break;
case SWT_COLOUR:
key.setBackground(1, ((Color[]) colourObj[1])[0]);
break;
default:
break;
}
}
for (TreeItem ti2 : ti.getItems()) {
updateColoursHelper(ti2);
}
}
示例13: initStyleMaps
import org.eclipse.wb.swt.SWTResourceManager; //导入依赖的package包/类
/**
* Initialize the map of the styles
*/
private void initStyleMaps() {
styleMaps = new HashMap<Object, StyleContainer>();
ovverridenAttributes = new HashSet<String>();
if (leftStringColor == null) {
leftStringColor = SWTResourceManager.getColor(42, 96, 213);
}
JRStyle defaultValue = getElement().getJasperDesign().getDefaultStyle();
List<INode> list = getStylesRoot(getElement()).getChildren();
List<INode> externalList = new ArrayList<INode>();
for (INode style : list) {
if (style instanceof MStyle) {
MStyle element = (MStyle) style;
styleMaps.put(element.getValue(), new StyleContainer(element));
if (element.getValue() == defaultValue) defaultStyle = element;
} else if (style instanceof MStyleTemplate) {
externalList.add(style);
}
}
recursiveReadStyles(externalList, null,defaultValue);
}
示例14: setupFigure
import org.eclipse.wb.swt.SWTResourceManager; //导入依赖的package包/类
/**
* Sets the up figure.
*
* @param rect
* the new up figure
*/
protected void setupFigure(IFigure rect) {
ANode model = getModel();
rect.setToolTip(new Label(model.getToolTip()));
MCallout m = getModel();
int x = (Integer) m.getPropertyValue(JRDesignElement.PROPERTY_X) + ReportPageFigure.PAGE_BORDER.left;
int y = (Integer) m.getPropertyValue(JRDesignElement.PROPERTY_Y) + ReportPageFigure.PAGE_BORDER.top;
int w = (Integer) m.getPropertyValue(JRDesignElement.PROPERTY_WIDTH);
int h = (Integer) m.getPropertyValue(JRDesignElement.PROPERTY_HEIGHT);
String text = (String) m.getPropertyValue(MCallout.PROP_TEXT);
((CalloutFigure) rect).setText(text);
rect.setBackgroundColor(SWTResourceManager.getColor(
AlfaRGB.safeGetRGB((AlfaRGB) m.getPropertyValue(MCallout.PROP_BACKGROUND))));
rect.setForegroundColor(SWTResourceManager.getColor(
AlfaRGB.safeGetRGB((AlfaRGB) m.getPropertyValue(MCallout.PROP_FOREGROUND))));
rect.setBounds(new Rectangle(x, y, w, h));
}
示例15: createControl
import org.eclipse.wb.swt.SWTResourceManager; //导入依赖的package包/类
@Override
public void createControl(Composite parent) {
Composite container = new Composite(parent, SWT.NULL);
setControl(container);
GridLayout layout = new GridLayout(1,false);
layout.marginTop = 46;
layout.verticalSpacing = 10;
container.setLayout(layout);
Label lblCongratulations = new Label(container, SWT.NONE);
Font font = lblCongratulations.getFont();
lblCongratulations.setFont(SWTResourceManager.getFont(font.getFontData()[0].getName(), 18, SWT.NORMAL));
lblCongratulations.setText(textCongratulations);
lblCongratulations.setLayoutData(fieldData[0] != null ? fieldData[0] : new GridData(SWT.FILL, SWT.LEFT, true, false));
Label lblAllTheInformation = new Label(container, SWT.WRAP);
lblAllTheInformation.setLayoutData(fieldData[1] != null ? fieldData[1] : new GridData(SWT.FILL, SWT.FILL, true, false));
lblAllTheInformation.setText(textAllTheInformation);
Label lblPressFinishTo = new Label(container, SWT.NONE);
lblPressFinishTo.setText(textPressFinishTo);
lblPressFinishTo.setLayoutData(fieldData[2] != null ? fieldData[2] : new GridData(SWT.FILL, SWT.LEFT, true, false));
}