Examples of Device


Examples of org.eclipse.swt.graphics.Device

        save.dispose();
    }

    @Override
    public void paintBefore(MapValues map, GC gc) {
        Device device = gc.getDevice();
       
        path = new Path(device);
        path.moveTo(0, 0);
        path.lineTo(-NEEDLEWIDTH, NEEDLEHEIGHT);
        path.quadTo(-CP_X_OFFSET, +CP_Y_OFFSET, 0, HEAD_Y_OFFSET);
        path.quadTo(CP_X_OFFSET, CP_Y_OFFSET, NEEDLEWIDTH, NEEDLEHEIGHT);
        path.lineTo(0, 0);       
        path.close();
       
        gc.setAlpha(255);
        Color red = new Color(device, 252, 99, 58);
        gc.setForeground(device.getSystemColor(SWT.COLOR_BLACK));
        gc.setBackground(red);
        red.dispose();
        gc.setLineWidth(SELECTION_STROKE);
    }
View Full Code Here

Examples of org.eclipse.swt.graphics.Device

    @Override
    public void paintControl(PaintEvent e) {
        if (!(e.widget instanceof Canvas)) throw new Error();
        try {
            GC gc = e.gc;
            Device device = gc.getDevice();
            Color waterColor = colorScheme().getWaterColor().asSWTColor(device);
            gc.setBackground(waterColor);
            gc.fillRectangle(gc.getClipping());
           
            Point bounds = ((Canvas) e.widget).getSize();
View Full Code Here

Examples of org.jclouds.cloudsigma.domain.Device

         // Note: I wanted to use node.getHardware().getVolumes() but there is no
         // way to go from a Volume to a DriveInfo

         ServerInfo serverInfo = api.getServerInfo(node.getId());
         Device rootDevice = get(serverInfo.getDevices().values(), 0);
         DriveInfo driveInfo = api.getDriveInfo(rootDevice.getDriveUuid());
         assertTrue(contains(driveInfo.getTags(), "affinity:ssd"));

      } finally {
         client.destroyNodesMatching(inGroup(group));
      }
View Full Code Here

Examples of org.jclouds.elasticstack.domain.Device

      @Override
      public String apply(Server from) {
         String imageId = null;
         String bootDeviceId = Iterables.get(from.getBootDeviceIds(), 0);
         Device bootDevice = from.getDevices().get(bootDeviceId);
         if (bootDevice != null) {
            try {
               DriveInfo drive = cache.getUnchecked(bootDevice.getDriveUuid());
               imageId = drive.getName();
            } catch (NullPointerException e) {
               logger.debug("drive %s not found", bootDevice.getDriveUuid());
            } catch (UncheckedExecutionException e) {
               logger.warn(e, "error finding drive %s: %s", bootDevice.getDriveUuid(), e.getMessage());
            }
         }
         return imageId;
      }
View Full Code Here

Examples of org.jnode.apps.jpartition.model.Device

                                "Format selection", JOptionPane.PLAIN_MESSAGE, null, options,
                                options[0]);

                if ((option != null) && (option.length() > 0)) {
                    UserFacade.getInstance().selectFormatter(option);
                    Device dev = UserFacade.getInstance().getSelectedDevice();
                    try {
                        UserFacade.getInstance().formatPartition(dev.getStart());
                    } catch (Exception e1) {
                        errorReporter.reportError(log, FormatPartitionAction.this, e1);
                    }
                    view.update();
                }
View Full Code Here

Examples of org.jnode.driver.Device

            // Show all devices.
            listAvailableDevices(dm, out);
            return;
        }

        Device dev = ARG_DEVICE.getValue();
        // FIXME PartitionHelper assumes that the device is an IDE device !?!
        if (!(dev instanceof IDEDevice)) {
            err.println(dev.getId() + " is not an IDE device");
            exit(1);
        }
        final PartitionHelper helper = new PartitionHelper(dev.getId(), out);
        try {
            helper.checkMBR();
        } catch (IOException ioex) {
            out.println(ioex.getMessage());
            out.println("Create a new MBR with a valid partition table.");
View Full Code Here

Examples of org.jsynthlib.device.model.Device

        LOG.info("Receiving drivers for device " + deviceName);
        List<Class<? extends IDriver>> driversForDevice =
                guiHandler.getDriversForDevice(deviceName);

        boolean deviceCreated = false;
        Device device = null;
        try {
            for (Class<? extends IDriver> driverClass : driversForDevice) {
                StringBuilder popupBuilder = new StringBuilder();

                LOG.info("Using driver: " + driverClass.getName());
                PopupListener driverPopupListener = new PopupListener();
                guiHandler.newPatch(library, deviceName, driverClass,
                        driverPopupListener);
                List<PopupContainer> driverPopups =
                        driverPopupListener.getPopups();
                for (PopupContainer popup : driverPopups) {
                    popupBuilder.append(popup.getContents());
                    popupBuilder.append("\n\n--------------------------\n\n");
                }

                LOG.info("Opening patch editor");
                PopupListener editorPopupListener = new PopupListener();
                FrameWrapper patchEditor =
                        guiHandler.openPatchEditor(table, -1, 0,
                                editorPopupListener, true);
                List<PopupContainer> editorPopups =
                        editorPopupListener.getPopups();
                for (PopupContainer popup : editorPopups) {
                    popupBuilder.append(popup.getContents());
                    popupBuilder.append("\n\n--------------------------\n\n");
                }

                try {
                    if (patchEditor == null) {
                        // No editor at all showed up.
                        continue;
                    }

                    Container component = patchEditor.component();
                    if (component instanceof MDIFrameProxy) {
                        MDIFrameProxy proxy = (MDIFrameProxy) component;
                        JSLFrame jslFrame = proxy.getJSLFrame();
                        if (jslFrame instanceof PatchEditorFrame) {
                            PatchEditorFrame frame =
                                    (PatchEditorFrame) jslFrame;
                            IDriver driver = frame.getPatch().getDriver();
                            if (!deviceCreated) {
                                device = driver.getDevice();
                                createDevice(device, infoText);
                                deviceCreated = true;
                            }
                            createPatchDriver(patchEditor, infoText,
                                    (IPatchDriver) driver);
                        } else if (jslFrame instanceof BankEditorFrame) {
                            BankEditorFrame frame = (BankEditorFrame) jslFrame;
                            IDriver driver = frame.getBankData().getDriver();
                            if (!deviceCreated) {
                                device = driver.getDevice();
                                createDevice(device, infoText);
                                deviceCreated = true;
                            }
                            createBankDriver(infoText, patchEditor,
                                    (IBankDriver) driver);
                        }
                    }

                } finally {
                    if (patchEditor != null) {
                        LOG.info("Close patch editor frame");
                        guiHandler.closeFrame(patchEditor, false);
                    }

                    if (library != null) {
                        LOG.info("Selecting library frame");
                        guiHandler.selectLibraryFrame(library);
                    }
                }
            }
        } finally {
            if (!deviceCreated) {
                throw new IllegalStateException("Device was never created");
            }
            properties.store(new FileOutputStream(new File(outDir, device
                    .getClass().getSimpleName() + ".properties")), null);
            deviceSpecDocument.save(new File(outDir, device.getClass()
                    .getSimpleName() + ".xml"));

            if (library != null) {
                LOG.info("Closing library");
                guiHandler.closeLibrary(library);
View Full Code Here

Examples of org.openhab.binding.digitalstrom.internal.client.entity.Device

        if (needsUpdate) {
          logger.debug("item '{}' is about to be refreshed now",
              itemName);

          Device device = getDsidToDeviceMap().get(
              itemConf.dsid.getValue());
          if (device != null) {
            SensorIndexEnum sensorIndex = null;
            try {
              sensorIndex = SensorIndexEnum
View Full Code Here

Examples of org.openhab.binding.maxcube.internal.message.Device

              }
            } else if (message.getType() == MessageType.L) {
              Collection<? extends Device> tempDevices = ((L_Message) message).getDevices(configurations);

              for (Device d : tempDevices) {
                Device existingDevice = findDevice(d.getSerialNumber(), devices);
                if (existingDevice == null) {
                  devices.add(d);
                } else {
                  devices.remove(existingDevice);
                  devices.add(d);
                }
              }

              logger.debug("{} devices found.", devices.size());

              // the L message is the last one, while the reader
              // would hang trying to read a new line and
              // eventually the
              // cube will fail to establish
              // new connections for some time
              cont = false;
            }
          }
        } catch (Exception e) {
          logger.info("Failed to process message received by MAX! protocol.");
          logger.debug(Utils.getStackTrace(e));
        }
      }

      socket.close();

      for (MaxCubeBindingProvider provider : providers) {
        for (String itemName : provider.getItemNames()) {
          String serialNumber = provider.getSerialNumber(itemName);

          Device device = findDevice(serialNumber, devices);

          if (device == null) {
            logger.info("Cannot find MAX!cube device with serial number '{}'", serialNumber);

            if (logger.isDebugEnabled()) {
              StringBuilder sb = new StringBuilder();
              sb.append("Available MAX! devices are:");
              for (Device d : devices) {
                sb.append("\n\t");
                sb.append(d.getSerialNumber());
              }
              logger.debug(sb.toString());
            }
            continue;
          }

          switch (device.getType()) {
          case HeatingThermostatPlus:
          case HeatingThermostat:
            if (provider.getBindingType(itemName) == BindingType.VALVE) {
              eventPublisher.postUpdate(itemName, ((HeatingThermostat) device).getValvePosition());
            } else if (provider.getBindingType(itemName) == BindingType.MODE) {
View Full Code Here

Examples of org.openhab.binding.neohub.internal.InfoResponse.Device

  }

  private State mapResponseToState(final InfoResponse infoResponse,
      final String deviceName, final NeoStatProperty property) {
    final Device deviceInfo = infoResponse.getDevice(deviceName);
    switch (property) {
    case CurrentTemperature:
      return new DecimalType(deviceInfo.getCurrentTemperature());
    case CurrentFloorTemperature:
      return new DecimalType(deviceInfo.getCurrentFloorTemperature());
    case CurrentSetTemperature:
      return new DecimalType(deviceInfo.getCurrentSetTemperature());
    case DeviceName:
      return new StringType(deviceInfo.getDeviceName());
    case Away:
      return deviceInfo.isAway() ? OnOffType.ON : OnOffType.OFF;
    case Standby:
      return deviceInfo.isStandby() ? OnOffType.ON : OnOffType.OFF;
    case Heating:
      return deviceInfo.isHeating() ? OnOffType.ON : OnOffType.OFF;
    default:
      throw new IllegalStateException(
          String.format(
              "No result mapping configured for this neo stat property: %s",
              property));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.