|
| 1 | +////////////////////////////////////////////////////////////////////// |
| 2 | +// |
| 3 | +// The JavaPOS library source code is now under the CPL license, which |
| 4 | +// is an OSS Apache-like license. The complete license is located at: |
| 5 | +// http://www.ibm.com/developerworks/library/os-cpl.html |
| 6 | +// |
| 7 | +////////////////////////////////////////////////////////////////////// |
| 8 | +//------------------------------------------------------------------------------ |
| 9 | +// |
| 10 | +// THIS SOFTWARE IS PROVIDED AS IS. THE JAVAPOS WORKING GROUP MAKES NO |
| 11 | +// REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE SOFTWARE, |
| 12 | +// EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED |
| 13 | +// WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR |
| 14 | +// NON-INFRINGEMENT. INDIVIDUAL OR CORPORATE MEMBERS OF THE JAVAPOS |
| 15 | +// WORKING GROUP SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED AS A RESULT |
| 16 | +// OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. |
| 17 | +// |
| 18 | +// GraphicDisplayBeanInfo.java - Bean information for the JavaPOS GraphicDisplay |
| 19 | +// device control |
| 20 | +// |
| 21 | +//------------------------------------------------------------------------------ |
| 22 | + |
| 23 | +package jpos; |
| 24 | + |
| 25 | +import java.beans.*; |
| 26 | + |
| 27 | +public class GraphicDisplayBeanInfo |
| 28 | + extends SimpleBeanInfo |
| 29 | +{ |
| 30 | + public BeanDescriptor getBeanDescriptor() |
| 31 | + { |
| 32 | + return new BeanDescriptor(jpos.GraphicDisplay.class); |
| 33 | + } |
| 34 | + |
| 35 | + public PropertyDescriptor makeProperty(String propertyName) |
| 36 | + throws IntrospectionException |
| 37 | + { |
| 38 | + return new PropertyDescriptor(propertyName, jpos.GraphicDisplay.class); |
| 39 | + } |
| 40 | + |
| 41 | + public PropertyDescriptor[] getPropertyDescriptors() |
| 42 | + { |
| 43 | + try |
| 44 | + { |
| 45 | + PropertyDescriptor[] properties = |
| 46 | + { |
| 47 | + // Capabilities |
| 48 | + makeProperty("CapAssociatedHardTotalsDevice"), |
| 49 | + makeProperty("CapBrightness"), |
| 50 | + makeProperty("CapCompareFirmwareVersion"), |
| 51 | + makeProperty("CapImageType"), |
| 52 | + makeProperty("CapPowerReporting"), |
| 53 | + makeProperty("CapStatisticsReporting"), |
| 54 | + makeProperty("CapStorage"), |
| 55 | + makeProperty("CapURLBack"), |
| 56 | + makeProperty("CapURLForward"), |
| 57 | + makeProperty("CapUpdateFirmware"), |
| 58 | + makeProperty("CapUpdateStatistics"), |
| 59 | + makeProperty("CapVideoType"), |
| 60 | + makeProperty("CapVolume"), |
| 61 | + |
| 62 | + // Properties |
| 63 | + makeProperty("Brightness"), |
| 64 | + makeProperty("DisplayMode"), |
| 65 | + makeProperty("ImageType"), |
| 66 | + makeProperty("ImageTypeList"), |
| 67 | + makeProperty("LoadStatus"), |
| 68 | + makeProperty("OutputID"), |
| 69 | + makeProperty("PowerNotify"), |
| 70 | + makeProperty("PowerState"), |
| 71 | + makeProperty("Storage"), |
| 72 | + makeProperty("URL"), |
| 73 | + makeProperty("VideoType"), |
| 74 | + makeProperty("VideoTypeList"), |
| 75 | + makeProperty("Volume") |
| 76 | + }; |
| 77 | + |
| 78 | + return properties; |
| 79 | + } |
| 80 | + catch(Exception e) |
| 81 | + { |
| 82 | + return super.getPropertyDescriptors(); |
| 83 | + } |
| 84 | + } |
| 85 | + |
| 86 | + public EventSetDescriptor makeEvent(String eventName) |
| 87 | + throws IntrospectionException, ClassNotFoundException |
| 88 | + { |
| 89 | + String listener = "jpos.events." + eventName + "Listener"; |
| 90 | + return new EventSetDescriptor(jpos.GraphicDisplay.class, |
| 91 | + eventName, |
| 92 | + Class.forName(listener), |
| 93 | + eventName + "Occurred"); |
| 94 | + } |
| 95 | + |
| 96 | + public EventSetDescriptor[] getEventSetDescriptors() |
| 97 | + { |
| 98 | + try |
| 99 | + { |
| 100 | + EventSetDescriptor[] events = |
| 101 | + { |
| 102 | + makeEvent("DirectIO"), |
| 103 | + makeEvent("Error"), |
| 104 | + makeEvent("OutputComplete"), |
| 105 | + makeEvent("StatusUpdate") |
| 106 | + }; |
| 107 | + |
| 108 | + return events; |
| 109 | + } |
| 110 | + catch(Exception e) |
| 111 | + { |
| 112 | + return super.getEventSetDescriptors(); |
| 113 | + } |
| 114 | + } |
| 115 | +} |
0 commit comments