1 50 51 package org.openlaszlo.iv.flash.commands; 52 53 import org.openlaszlo.iv.flash.parser.*; 54 import org.openlaszlo.iv.flash.api.*; 55 import org.openlaszlo.iv.flash.util.*; 56 57 import org.openlaszlo.iv.flash.context.Context; 58 59 public class SetBrightnessCommand extends GenericCommand { 60 61 public SetBrightnessCommand() {} 62 63 public void doCommand( FlashFile file, Context context, Script parent, int frameNum ) throws IVException { 64 Instance inst = getCommandInstance(file, context, parent, frameNum); 65 66 processFlashDef(inst, file, context); 68 69 String percent = getParameter( context, "percent" ); 70 double f = 0.0; 71 72 if( percent != null ) { 73 try { 74 f = Double.valueOf(percent).doubleValue(); 75 if( f < -100.0 || f > 100.0 ) { 76 Log.logRB(Resource.INVALALPHA, new Object [] {percent, getCommandName()}); 77 f = 0.0; 78 } 79 } catch( NumberFormatException e ) { 80 Log.logRB(Resource.INVALALPHA, new Object [] {percent, getCommandName()}); 81 f = 0.0; 82 } 83 } 84 inst.cxform = CXForm.newBrightness( f/100.0, true); 85 } 86 87 } 88 | Popular Tags |