Package javax.print.attribute.standard

Examples of javax.print.attribute.standard.JobPriority


        priorityLabel.setEnabled(enabled);
        prtSpinner.setEnabled(enabled);
   
        if (firstUse) {
            if (attrs.containsKey(JobPriority.class)) {
                JobPriority value = (JobPriority) (attrs.get(JobPriority.class));
                prtSpinner.setValue(new Integer(value.getValue()));
            } else {
                if (enabled) {
                    JobPriority defaul = (JobPriority)  (
                            myService.getDefaultAttributeValue(JobPriority.class));
                    prtSpinner.setValue (defaul == null
                            ? new Integer(1)
                            : new Integer(defaul.getValue()));
                } else {
                    prtSpinner.setValue(new Integer(1));
                }
            }
        }
View Full Code Here


     * spinner is enabled. Remove JobPriority otherwise.
    */
    private void updatePriority() {
        if (prtSpinner.isEnabled()) {
            int priority = ((Integer) (prtSpinner.getValue())).intValue();
            newAttrs.add(new JobPriority(priority));
        } else {
            removeAttribute(JobPriority.class);
        }
    }
View Full Code Here

      }

      public void stateChanged(ChangeEvent event)
      {
        int value = ((Integer) priority.getValue()).intValue();
        atts.add(new JobPriority(value));
      }
View Full Code Here

      void updateForSelectedService()
      {
        // JobPriority
        if (categorySupported(JobPriority.class))
          {
            JobPriority prio = (JobPriority) attribute(JobPriority.class);
            JobPriority value = (JobPriority) defaultValue(JobPriority.class);
            priority.setEnabled(true);
            if (prio != null)
              model.setValue(new Integer(prio.getValue()));
            else
              model.setValue(new Integer(value.getValue()));
          }
        else
          priority.setEnabled(false);

        // Requesting username
        if (categorySupported(RequestingUserName.class))
          {
            Attribute user = attribute(RequestingUserName.class);
            Object value = defaultValue(RequestingUserName.class);
            username.setEnabled(true);
            if (user != null)
              username_tf.setText(user.toString());
            else
              username_tf.setText(value.toString());
          }
        else
          username.setEnabled(false);

        // Job Name
        if (categorySupported(JobName.class))
          {
            Attribute job = attribute(JobName.class);
            Object value = defaultValue(JobName.class);
            jobname.setEnabled(true);
            if (job != null)
              jobname_tf.setText(job.toString());
            else
              jobname_tf.setText(value.toString());
          }
        else
          jobname.setEnabled(false);

        // Job sheets
        if (categorySupported(JobSheets.class))
          {
            Attribute sheet = attribute(JobSheets.class);
            Object value = defaultValue(JobSheets.class);
            cover.setEnabled(true);
            if (sheet != null)
              {
                if (sheet.equals(JobSheets.NONE))
                  cover.setSelected(false);
                else
                  cover.setSelected(true);
              }
            else
              {
                if (value.equals(JobSheets.NONE))
                  cover.setSelected(false);
                else
                  cover.setSelected(true);
              }
          }
View Full Code Here

TOP

Related Classes of javax.print.attribute.standard.JobPriority

Copyright © 2018 www.massapicom. 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.