001/* [{
002Copyright 2007, 2008 Nicolas Carranza <nicarran at gmail.com>
003
004This file is part of jpen.
005
006jpen is free software: you can redistribute it and/or modify
007it under the terms of the GNU Lesser General Public License as published by
008the Free Software Foundation, either version 3 of the License,
009or (at your option) any later version.
010
011jpen is distributed in the hope that it will be useful,
012but WITHOUT ANY WARRANTY; without even the implied warranty of
013MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
014GNU Lesser General Public License for more details.
015
016You should have received a copy of the GNU Lesser General Public License
017along with jpen.  If not, see <http://www.gnu.org/licenses/>.
018}] */
019package jpen;
020
021import java.util.Collection;
022
023public interface PenDevice {
024
025        PenProvider getProvider();
026
027        int getKindTypeNumber();
028
029        void setKindTypeNumber(int kindTypeNumber);
030
031        void setEnabled(boolean enabled);
032
033        boolean getEnabled();
034
035        String getName();
036        /**
037        @return A unique and constant id. This id is assigned at runtime by the {@link PenManager} and can change between restarts.
038        
039        @see #getPhysicalId()
040        */
041        byte getId();
042        
043        /**
044        Don't call this method. It is only for use by the {@link PenManager}. This method is called when the device is being constructed to set a meaningful {@code id}.
045        
046        @see PLevelEvent#getDeviceId()
047        */
048        void penManagerSetId(byte id);
049        
050        /**
051        @return A unique and constant id. This {@code physicalId} is always the same for the given device, even if the program restarts. Each PenDevice has a different {@code physicalId}.  
052        */
053        String getPhysicalId();
054        
055        /**
056        @return {@code true} if this device uses fractional (floating point precision) movement levels.
057        */
058        boolean getUseFractionalMovements();
059        
060        /**
061        Don't call this method. It is only for use by the {@link PenManager}. This method is called when the provider {@link PenProvider#getUseRelativeLocationFilter()} is {@code true} and this {@code PenDevice} must change its {@code useFractionalMovement} mode.
062        
063        @see #getUseFractionalMovements()
064        */
065        void penManagerSetUseFractionalMovements(boolean useFractionalMovements);
066        
067}