use of com.biglybt.ui.swt.skin.SWTSkinObjectText in project BiglyBT by BiglySoftware.
the class SBC_DevicesView method setAdditionalInfoTitle.
/**
* @param newVisibility
*
* @since 4.1.0.5
*/
protected void setAdditionalInfoTitle(boolean newVisibility) {
SWTSkinObject soArea = getSkinObject("advinfo-area");
if (soArea != null) {
soArea.setVisible(newVisibility);
}
SWTSkinObject soText = getSkinObject("advinfo-title");
if (soText instanceof SWTSkinObjectText) {
String s = (newVisibility ? "[-]" : "[+]");
if (device != null) {
s += "Additional Device Info and Settings";
} else {
s += "General Options";
}
((SWTSkinObjectText) soText).setText(s);
}
}
use of com.biglybt.ui.swt.skin.SWTSkinObjectText in project BiglyBT by BiglySoftware.
the class PlayerInstallWindow method open.
public void open() {
box = new VuzeMessageBox("", "", null, 0);
box.setSubTitle(MessageText.getString("dlg.player.install.subtitle"));
box.addResourceBundle(PlayerInstallWindow.class, SkinPropertiesImpl.PATH_SKIN_DEFS, "skin3_dlg_register");
box.setIconResource("image.player.dlg.header");
this.progressText = MessageText.getString("dlg.player.install.description");
box.setListener(new VuzeMessageBoxListener() {
@Override
public void shellReady(Shell shell, SWTSkinObjectContainer soExtra) {
SWTSkin skin = soExtra.getSkin();
skin.createSkinObject("dlg.register.install", "dlg.register.install", soExtra);
SWTSkinObjectContainer soProgressBar = (SWTSkinObjectContainer) skin.getSkinObject("progress-bar");
if (soProgressBar != null) {
progressBar = new ProgressBar(soProgressBar.getComposite(), SWT.HORIZONTAL);
progressBar.setMinimum(0);
progressBar.setMaximum(100);
progressBar.setLayoutData(Utils.getFilledFormData());
}
soInstallPct = (SWTSkinObjectText) skin.getSkinObject("install-pct");
soProgressText = (SWTSkinObjectText) skin.getSkinObject("progress-text");
if (soProgressText != null && progressText != null) {
soProgressText.setText(progressText);
}
}
});
box.open(new UserPrompterResultListener() {
@Override
public void prompterClosed(int result) {
installer.setListener(null);
installer.cancel();
}
});
}
use of com.biglybt.ui.swt.skin.SWTSkinObjectText in project BiglyBT by BiglySoftware.
the class SBC_DevicesView method skinObjectInitialShow.
// @see SkinView#skinObjectInitialShow(SWTSkinObject, java.lang.Object)
@Override
public Object skinObjectInitialShow(SWTSkinObject skinObject, Object params) {
CoreFactory.addCoreRunningListener(new CoreRunningListener() {
@Override
public void coreRunning(Core core) {
initColumns(core);
}
});
device_manager = DeviceManagerFactory.getSingleton();
transcode_manager = device_manager.getTranscodeManager();
transcode_queue = transcode_manager.getQueue();
MultipleDocumentInterfaceSWT mdi = UIFunctionsManagerSWT.getUIFunctionsSWT().getMDISWT();
if (mdi != null) {
mdiEntry = mdi.getCurrentEntrySWT();
Object ds = mdiEntry.getDatasource();
if (!(ds instanceof Device)) {
return (null);
}
device = (Device) ds;
}
if (device instanceof TranscodeTarget) {
transTarget = (TranscodeTarget) device;
}
if (device == null) {
new InfoBarUtil(skinObject, "devicesview.infobar", false, "DeviceView.infobar", "v3.deviceview.infobar") {
@Override
public boolean allowShow() {
return true;
}
};
} else if (device instanceof DeviceMediaRenderer) {
DeviceMediaRenderer renderer = (DeviceMediaRenderer) device;
int species = renderer.getRendererSpecies();
String speciesID = null;
switch(species) {
case DeviceMediaRenderer.RS_ITUNES:
speciesID = "itunes";
break;
case DeviceMediaRenderer.RS_PS3:
speciesID = "ps3";
break;
case DeviceMediaRenderer.RS_XBOX:
speciesID = "xbox";
break;
case DeviceMediaRenderer.RS_OTHER:
{
String classification = renderer.getClassification();
if (classification.equals("sony.PSP")) {
speciesID = "psp";
} else if (classification.startsWith("tivo.")) {
speciesID = "tivo";
} else if (classification.toLowerCase().contains("android")) {
speciesID = "android";
}
}
default:
break;
}
if (speciesID != null) {
final String fSpeciesID = speciesID;
new InfoBarUtil(skinObject, "devicesview.infobar", false, "DeviceView.infobar." + speciesID, "v3.deviceview.infobar") {
@Override
public boolean allowShow() {
return true;
}
// @see InfoBarUtil#created(SWTSkinObject)
@Override
protected void created(SWTSkinObject parent) {
SWTSkinObjectText soLine1 = (SWTSkinObjectText) skin.getSkinObject("line1", parent);
soLine1.setTextID("v3.deviceview.infobar.line1.generic", new String[] { device.getName() });
SWTSkinObjectText soLine2 = (SWTSkinObjectText) skin.getSkinObject("line2", parent);
soLine2.setTextID("v3.deviceview.infobar.line2." + fSpeciesID);
}
};
}
}
SWTSkinObject soAdvInfo = getSkinObject("advinfo");
if (soAdvInfo != null) {
initAdvInfo(soAdvInfo);
}
if (device != null) {
device_name = device.getName();
SWTSkinObject soTitle = getSkinObject("title");
if (soTitle instanceof SWTSkinObjectText) {
((SWTSkinObjectText) soTitle).setTextID("device.view.heading", new String[] { device_name });
}
}
return null;
}
use of com.biglybt.ui.swt.skin.SWTSkinObjectText in project BiglyBT by BiglySoftware.
the class SBC_DevicesView method deviceChanged.
@Override
public void deviceChanged(Device device) {
String name = device.getName();
if (!name.equals(device_name)) {
device_name = name;
// ensure name is up to date
SWTSkinObject soTitle = getSkinObject("title");
if (soTitle instanceof SWTSkinObjectText) {
((SWTSkinObjectText) soTitle).setTextID("device.view.heading", new String[] { name });
}
}
}
use of com.biglybt.ui.swt.skin.SWTSkinObjectText in project BiglyBT by BiglySoftware.
the class DeviceTemplateChooser method createDeviceTemplateList2.
private void createDeviceTemplateList2(SWTSkinObjectContainer soList) {
DeviceTemplate[] devices = mf.getDeviceTemplates();
if (devices.length == 0) {
noDevices();
return;
}
Arrays.sort(devices, new Comparator<DeviceTemplate>() {
@Override
public int compare(DeviceTemplate o1, DeviceTemplate o2) {
return o1.getName().compareToIgnoreCase(o2.getName());
}
});
Composite parent = soList.getComposite();
if (parent.getChildren().length > 0) {
Utils.disposeComposite(parent, false);
}
SWTSkin skin = skinnedDialog.getSkin();
RowLayout layout = new RowLayout(SWT.HORIZONTAL);
layout.spacing = 0;
layout.marginLeft = layout.marginRight = 0;
layout.wrap = true;
layout.justify = true;
layout.fill = true;
parent.setLayout(layout);
Listener clickListener = new Listener() {
boolean down = false;
@Override
public void handleEvent(Event event) {
if (event.type == SWT.MouseDown) {
down = true;
} else if (event.type == SWT.MouseUp && down) {
Widget widget = (event.widget instanceof Label) ? ((Label) event.widget).getParent() : event.widget;
selectedDeviceTemplate = (DeviceTemplate) widget.getData("obj");
if (selectedDeviceTemplate == null) {
Debug.out("selectedDeviceTemplate is null!");
}
skinnedDialog.close();
down = false;
}
}
};
for (DeviceTemplate deviceTemplate : devices) {
if (deviceTemplate.isAuto()) {
continue;
}
// deviceTemplate.getIconURL();
String iconURL = null;
TranscodeChooser.addImageBox(parent, clickListener, null, deviceTemplate, iconURL, deviceTemplate.getName());
}
SWTSkinObjectText soTitle = (SWTSkinObjectText) skin.getSkinObject("title");
if (soTitle != null) {
soTitle.setTextID("devices.choose.device.title");
}
SWTSkinObjectText soSubTitle = (SWTSkinObjectText) skin.getSkinObject("subtitle");
if (soSubTitle != null) {
soSubTitle.setTextID("label.clickone");
}
Shell shell = skinnedDialog.getShell();
Point computeSize = shell.computeSize(shell.getSize().x, SWT.DEFAULT, true);
shell.setSize(computeSize);
UIFunctionsSWT uiFunctionsSWT = UIFunctionsManagerSWT.getUIFunctionsSWT();
if (uiFunctionsSWT != null) {
Shell mainShell = uiFunctionsSWT.getMainShell();
Utils.centerWindowRelativeTo(shell, mainShell);
}
}
Aggregations