001/* % [{ 002% (C) Copyright 2008 Nicolas Carranza and individual contributors. 003% See the jpen-copyright.txt file in the jpen distribution for a full 004% listing of individual contributors. 005% 006% This file is part of jpen. 007% 008% jpen is free software: you can redistribute it and/or modify 009% it under the terms of the GNU Lesser General Public License as published by 010% the Free Software Foundation, either version 3 of the License, or 011% (at your option) any later version. 012% 013% jpen is distributed in the hope that it will be useful, 014% but WITHOUT ANY WARRANTY; without even the implied warranty of 015% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 016% GNU Lesser General Public License for more details. 017% 018% You should have received a copy of the GNU Lesser General Public License 019% along with jpen. If not, see <http://www.gnu.org/licenses/>. 020% }] */ 021package jpen; 022 023public class PenStateCopy 024 extends PenState 025 implements java.io.Serializable { 026 public static final long serialVersionUID=1l; 027 028 public PenStateCopy(){} 029 030 public PenStateCopy(PenState penState){ 031 setValues(penState); 032 } 033 034 public PenState.Levels getLevels(){ 035 return levels; 036 } 037 038 public void setLevelValue(PLevel level){ 039 levels.setValue(level.typeNumber, level.value); 040 } 041 042 public void setLevelValue(PLevel.Type type, float value){ 043 levels.setValue(type, value); 044 } 045 046 public void setLevelValue(int typeNumber, float value){ 047 levels.setValue(typeNumber, value); 048 } 049 050 public boolean setButtonValue(PButton button) { 051 return super.setButtonValue(button.typeNumber, button.value); 052 } 053 054 public boolean setButtonValue(int typeNumber, boolean value){ 055 return super.setButtonValue(typeNumber,value); 056 } 057 058 public boolean setButtonValue(PButton.Type type, boolean value){ 059 return super.setButtonValue(type.ordinal(), value); 060 } 061 062 public void setKind(PKind kind){ 063 super.setKind(kind); 064 } 065 066 public void setKind(PKind.Type type){ 067 super.setKind(PKind.valueOf(type.ordinal())); 068 } 069 070 public void setKind(int kindTypeNumber){ 071 super.setKind(PKind.valueOf(kindTypeNumber)); 072 } 073 074 public void setValues(PenState penState){ 075 super.setValues(penState); 076 } 077 078 public void setValues(PenEvent ev){ 079 ev.copyTo(this); 080 } 081}