Skip to content
Snippets Groups Projects
Commit e131a5fe authored by Thomas Oster's avatar Thomas Oster
Browse files

getPropertyClass-Method for LaserPropertys

parent 5e0da957
No related branches found
No related tags found
No related merge requests found
......@@ -225,4 +225,14 @@ public class FloatPowerSpeedFocusFrequencyProperty implements LaserProperty
{
return null;
}
@Override
public Class getPropertyClass(String name)
{
if ("power".equals(name)||"speed".equals(name)||"focus".equals(name)||"frequency".equals(name))
{
return Float.class;
}
return null;
}
}
......@@ -18,8 +18,6 @@
**/
package com.t_oster.liblasercut;
import java.util.List;
/**
* The LaserProperty holds all the parameters for parts of the LaserJob.
* The Frequency value is ignored for Engraving operations
......@@ -46,6 +44,14 @@ public interface LaserProperty extends Cloneable
public abstract void setProperty(String name, Object value);
/**
* If name is a name of a vaild property, return the class
* of this property's objects. else return null
* @param name
* @return
*/
public abstract Class getPropertyClass(String name);
/**
* returns the minimum value of this property if it is
* of type Double, Integer or Float and a minimum value
......
......@@ -118,6 +118,16 @@ public class PowerSpeedFocusFrequencyProperty extends PowerSpeedFocusProperty
}
}
@Override
public Class getPropertyClass(String name)
{
if ("frequency".equals(name))
{
return Integer.class;
}
return super.getPropertyClass(name);
}
@Override
public PowerSpeedFocusFrequencyProperty clone()
{
......
......@@ -192,6 +192,20 @@ public class PowerSpeedFocusProperty implements LaserProperty
}
}
@Override
public Class getPropertyClass(String name)
{
if ("power".equals(name)||"speed".equals(name))
{
return Integer.class;
}
else if ("focus".equals(name))
{
return Float.class;
}
return null;
}
@Override
public Object[] getPossibleValues(String name)
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment