use of com.google.gwt.event.dom.client.ClickHandler in project ovirt-engine by oVirt.
the class VolumeProfileStatisticsPopupView method edit.
@Override
public void edit(final VolumeProfileStatisticsModel object) {
driver.edit(object);
volumeProfileStats.asEditor().edit(object.getCumulativeStatistics());
nfsServerProfileStats.asEditor().edit(object.getNfsServerProfileStats());
profileRunTime.setText(object.getProfileRunTime());
nfsProfileRunTime.setText(object.getNfsProfileRunTime());
bytesRead.setText(object.getBytesRead());
nfsBytesRead.setText(object.getNfsBytesRead());
bytesWritten.setText(object.getBytesWritten());
nfsBytesWritten.setText(object.getNfsBytesWritten());
ClickHandler brickTabClickHandler = event -> object.queryBackend(true);
brickRefreshIcon.setRefreshIconClickListener(brickTabClickHandler);
ClickHandler nfsTabClickHandler = event -> object.queryBackend(false);
nfsRefreshIcon.setRefreshIconClickListener(nfsTabClickHandler);
object.getPropertyChangedEvent().addListener((ev, sender, args) -> {
if (args.propertyName.equals("brickProfileRunTimeChanged")) {
// $NON-NLS-1$
profileRunTime.setText(object.getProfileRunTime());
}
if (args.propertyName.equals("brickProfileDataRead")) {
// $NON-NLS-1$
bytesRead.setText(object.getBytesRead());
}
if (args.propertyName.equals("brickProfileDataWritten")) {
// $NON-NLS-1$
bytesWritten.setText(object.getBytesWritten());
}
if (args.propertyName.equals("nfsProfileRunTimeChanged")) {
// $NON-NLS-1$
nfsProfileRunTime.setText(object.getNfsProfileRunTime());
}
if (args.propertyName.equals("nfsProfileDataRead")) {
// $NON-NLS-1$
nfsBytesRead.setText(object.getNfsBytesRead());
}
if (args.propertyName.equals("nfsProfileDataWritten")) {
// $NON-NLS-1$
nfsBytesWritten.setText(object.getNfsBytesWritten());
}
if (args.propertyName.equals("statusOfFetchingProfileStats")) {
// $NON-NLS-1$
boolean disableErrorLabels = !object.isSuccessfulProfileStatsFetch();
if (!disableErrorLabels) {
String url = object.getProfileExportUrl();
// $NON-NLS-1$
boolean isBrickTabSelected = !url.contains(";nfsStatistics=true");
initAnchor(url, isBrickTabSelected ? brickProfileAnchor : nfsProfileAnchor);
}
bricksError.setVisible(disableErrorLabels);
nfsError.setVisible(disableErrorLabels);
}
});
}
use of com.google.gwt.event.dom.client.ClickHandler in project ovirt-engine by oVirt.
the class RefreshPanel method createDropdownMenu.
private void createDropdownMenu() {
dropdownMenu = new DropDownMenu();
dropdownMenu.setPull(Pull.LEFT);
Set<Integer> refreshRates = AbstractRefreshManager.getRefreshRates();
for (Integer refreshRate : refreshRates) {
AnchorListItem refreshRateItem = new AnchorListItem();
refreshRateItem.setText(MillisecondRenderer.getInstance().render(refreshRate));
refreshRateItem.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
refreshManager.setCurrentRefreshRate(refreshRate);
removeActiveStyles();
refreshRateItem.addStyleName(Styles.ACTIVE);
}
});
if (refreshManager.getCurrentRefreshRate() == refreshRate) {
refreshRateItem.addStyleName(Styles.ACTIVE);
}
dropdownMenu.add(refreshRateItem);
}
}
use of com.google.gwt.event.dom.client.ClickHandler in project closure-compiler by google.
the class DebuggerGwtMain method createCheckboxes.
private void createCheckboxes(CellPanel checkboxPanel) {
for (CompilationParam.ParamGroup group : CompilationParam.ParamGroup.values()) {
SafeHtmlBuilder builder = new SafeHtmlBuilder();
builder.appendHtmlConstant("<b>");
builder.appendEscaped(group.name);
builder.appendHtmlConstant("</b>");
checkboxPanel.add(new HTML(builder.toSafeHtml()));
for (final CompilationParam param : CompilationParam.getGroupedSortedValues().get(group)) {
CheckBox cb = new CheckBox(param.toString());
if (param.getJavaInfo() != null) {
cb.setTitle("Java API equivalent: " + param.getJavaInfo());
}
cb.setValue(param.getDefaultValue());
param.apply(options, param.getDefaultValue());
cb.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
boolean checked = ((CheckBox) event.getSource()).getValue();
param.apply(options, checked);
doCompile();
}
});
checkboxPanel.add(cb);
}
}
}
use of com.google.gwt.event.dom.client.ClickHandler in project webprotege by protegeproject.
the class EntityLabel method updateDisplay.
private void updateDisplay() {
typeLabel.setText(entityData.getEntity().getEntityType().getName() + ": ");
browserTextLabel.setText(entityData.getBrowserText());
browserTextLabel.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
if (selectionModel != null) {
selectionModel.setSelection(entityData.getEntity());
}
}
});
iriLabel.setText("(" + entityData.getEntity().getIRI().toQuotedString() + ")");
}
use of com.google.gwt.event.dom.client.ClickHandler in project gwt-cs by iSergio.
the class Terrain method buildPanel.
@Override
public void buildPanel() {
csVPanel = new ViewerPanel();
CesiumTerrainProviderOptions cesiumTerrainProviderOptions = new CesiumTerrainProviderOptions();
cesiumTerrainProviderOptions.url = "https://assets.agi.com/stk-terrain/world";
cesiumTerrainProviderOptions.requestWaterMask = true;
cesiumTerrainProviderOptions.requestVertexNormals = true;
cesiumTerrainProviderMeshes = new CesiumTerrainProvider(cesiumTerrainProviderOptions);
csVPanel.getViewer().terrainProvider = cesiumTerrainProviderMeshes;
Cartesian3 target = new Cartesian3(300770.50872389384, 5634912.131394585, 2978152.2865545116);
Cartesian3 offset = new Cartesian3(6344.974098678562, -793.3419798081741, 2499.9508860763162);
csVPanel.getViewer().camera.lookAt(target, offset);
csVPanel.getViewer().camera.lookAtTransform(Matrix4.IDENTITY());
ListBox terrainsLBox = new ListBox();
terrainsLBox.setWidth("130px");
terrainsLBox.addItem("CesiumTerrainProvider - STK World Terrain", "0");
terrainsLBox.addItem("CesiumTerrainProvider - STK World Terrain - no effects", "1");
terrainsLBox.addItem("CesiumTerrainProvider - STK World Terrain w/ Lighting", "2");
terrainsLBox.addItem("CesiumTerrainProvider - STK World Terrain w/ Water", "3");
terrainsLBox.addItem("EllipsoidTerrainProvider", "4");
terrainsLBox.addItem("VRTheWorldTerrainProvider", "5");
terrainsLBox.addItem("GeoserverTerrainProvider", "6");
terrainsLBox.addChangeHandler(new ChangeHandler() {
@Override
public void onChange(ChangeEvent changeEvent) {
ListBox source = (ListBox) changeEvent.getSource();
switch(source.getSelectedValue()) {
case "0":
{
csVPanel.getViewer().terrainProvider = cesiumTerrainProviderMeshes;
csVPanel.getViewer().scene().globe.enableLighting = true;
}
break;
case "1":
{
CesiumTerrainProviderOptions options = new CesiumTerrainProviderOptions();
options.url = "https://assets.agi.com/stk-terrain/world";
csVPanel.getViewer().terrainProvider = new CesiumTerrainProvider(options);
}
break;
case "2":
{
CesiumTerrainProviderOptions options = new CesiumTerrainProviderOptions();
options.url = "https://assets.agi.com/stk-terrain/world";
options.requestVertexNormals = true;
csVPanel.getViewer().terrainProvider = new CesiumTerrainProvider(options);
csVPanel.getViewer().scene().globe.enableLighting = true;
}
break;
case "3":
{
CesiumTerrainProviderOptions options = new CesiumTerrainProviderOptions();
options.url = "https://assets.agi.com/stk-terrain/world";
options.requestWaterMask = true;
csVPanel.getViewer().terrainProvider = new CesiumTerrainProvider(options);
csVPanel.getViewer().scene().globe.enableLighting = true;
}
break;
case "4":
{
csVPanel.getViewer().terrainProvider = new EllipsoidTerrainProvider();
}
break;
case "5":
{
VRTheWorldTerrainProviderOptions options = new VRTheWorldTerrainProviderOptions();
options.url = "http://www.vr-theworld.com/vr-theworld/tiles1.0.0/73/";
csVPanel.getViewer().terrainProvider = new VRTheWorldTerrainProvider(options);
}
break;
case "6":
{
GeoserverTerrainProviderOptions options = new GeoserverTerrainProviderOptions();
options.url = "http://sergeserver.noip.me/geobase-portal/ows";
options.layerName = "geoserver:geobase:SRTM90";
options.styleName = "geobase:grayToColor";
csVPanel.getViewer().terrainProvider = new GeoserverTerrainProvider(options);
}
break;
default:
break;
}
}
});
ListBox targetsLBox = new ListBox();
targetsLBox.addItem("Mount Everest", "0");
targetsLBox.addItem("Half Dome", "1");
targetsLBox.addItem("San Francisco Bay", "2");
targetsLBox.addChangeHandler(new ChangeHandler() {
@Override
public void onChange(ChangeEvent changeEvent) {
ListBox source = (ListBox) changeEvent.getSource();
switch(source.getSelectedValue()) {
case "0":
{
Cartesian3 target = new Cartesian3(300770.50872389384, 5634912.131394585, 2978152.2865545116);
Cartesian3 offset = new Cartesian3(6344.974098678562, -793.3419798081741, 2499.9508860763162);
csVPanel.getViewer().camera.lookAt(target, offset);
csVPanel.getViewer().camera.lookAtTransform(Matrix4.IDENTITY());
}
break;
case "1":
{
Cartesian3 target = new Cartesian3(-2489625.0836225147, -4393941.44443024, 3882535.9454173897);
Cartesian3 offset = new Cartesian3(-6857.40902037546, 412.3284835694358, 2147.5545426812023);
csVPanel.getViewer().camera.lookAt(target, offset);
csVPanel.getViewer().camera.lookAtTransform(Matrix4.IDENTITY());
}
break;
case "2":
{
Cartesian3 target = new Cartesian3(-2708814.85583248, -4254159.450845907, 3891403.9457429945);
Cartesian3 offset = new Cartesian3(70642.66030209465, -31661.517948317807, 35505.179997143336);
csVPanel.getViewer().camera.lookAt(target, offset);
csVPanel.getViewer().camera.lookAtTransform(Matrix4.IDENTITY());
}
default:
break;
}
}
});
ToggleButton lightingTBtn = new ToggleButton("Toggle Lighting");
lightingTBtn.setWidth("130px");
lightingTBtn.setValue(true);
lightingTBtn.addValueChangeHandler(new ValueChangeHandler<Boolean>() {
@Override
public void onValueChange(ValueChangeEvent<Boolean> valueChangeEvent) {
csVPanel.getViewer().scene().globe.enableLighting = !csVPanel.getViewer().scene().globe.enableLighting;
}
});
ToggleButton fogTBtn = new ToggleButton("Toggle Fog");
fogTBtn.setWidth("130px");
fogTBtn.setValue(true);
fogTBtn.addValueChangeHandler(new ValueChangeHandler<Boolean>() {
@Override
public void onValueChange(ValueChangeEvent<Boolean> valueChangeEvent) {
csVPanel.getViewer().scene().fog.enabled = !csVPanel.getViewer().scene().fog.enabled;
}
});
Button sampleBtn = new Button("Sample Everest Terrain");
sampleBtn.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent clickEvent) {
int gridWidth = 41;
int gridHeight = 41;
double everestLatitude = Math.toRadians(27.988257);
double everestLongitude = Math.toRadians(86.925145);
double rectangleHalfSize = 0.005;
Rectangle e = new Rectangle(everestLongitude - rectangleHalfSize, everestLatitude - rectangleHalfSize, everestLongitude + rectangleHalfSize, everestLatitude + rectangleHalfSize);
terrainSamplePositions = new ArrayList<>();
for (int y = 0; y < gridHeight; ++y) {
for (int x = 0; x < gridWidth; ++x) {
double lon = Math.lerp(e.west, e.east, (double) x / (gridWidth - 1.));
double lat = Math.lerp(e.south, e.north, (double) y / (gridHeight - 1.));
Cartographic position = new Cartographic(lon, lat);
terrainSamplePositions.add(position);
}
}
Promise<Cartographic[], Void> promise = Cesium.sampleTerrain(csVPanel.getViewer().terrainProvider, 9, terrainSamplePositions.toArray(new Cartographic[terrainSamplePositions.size()]));
promise.then(new Fulfill<Cartographic[]>() {
@Override
public void onFulfilled(Cartographic[] value) {
sampleTerrainSuccess();
}
});
}
});
VerticalPanel vPanel = new VerticalPanel();
vPanel.add(targetsLBox);
vPanel.add(terrainsLBox);
vPanel.add(lightingTBtn);
vPanel.add(fogTBtn);
vPanel.add(sampleBtn);
AbsolutePanel aPanel = new AbsolutePanel();
aPanel.add(csVPanel);
aPanel.add(vPanel, 20, 20);
contentPanel.add(new HTML("<p>Visualize worldwide, high-resolution terrain.</p>"));
contentPanel.add(aPanel);
initWidget(contentPanel);
}
Aggregations