Due to recent updates, all users are required to create an Altair One account to login to the RapidMiner community. Click the Register button to create your account using the same email that you have previously used to login to the RapidMiner community. This will ensure that any previously created content will be synced to your Altair One account. Once you login, you will be asked to provide a username that identifies you to other Community users. Email us at Community with questions.
[SOLVED] Quick fix doesn't work
Hello,
I'm writing my own QuickFix in MetaDataError class. The code looks like this:
Thanks for your responses.
Best,
Vaclav
I'm writing my own QuickFix in MetaDataError class. The code looks like this:
My ErrorsImage.properties file defined in build.xml by
public class BadColorMetaDataError extends ImageMetaDataError {
private boolean color = true;
public BadColorMetaDataError(InputPort inputPort, String message, boolean color) {
super(Severity.ERROR, inputPort, message);
this.color = color;
}
@Override
public List<? extends QuickFix> getQuickFixes() {
List<QuickFix> list = Collections.<QuickFix>emptyList();
if(color){
list.add(new OperatorInsertionQuickFix("insert_gs_to_color", new Object[0], 10, (InputPort)getPort()) {
@Override
public Operator createOperator() throws OperatorCreationException {
Operator op = OperatorService.createOperator(GrayScaleToColorOp.class);
return op;
}
});
} else {
list.add(new OperatorInsertionQuickFix("insert_color_to_gs", new Object[0], 10, (InputPort)getPort()) {
@Override
public Operator createOperator() throws OperatorCreationException {
Operator op = OperatorService.createOperator(ColorToGrayScaleOp.class);
return op;
}
});
}
return list;
}
}
looks like this:
<property name="extension.errorDescription" value="/com/rapidminer/resources/i18n/ErrorsImage.properties" />
When I run RapidMiner, I get this error:
metadata.quickfix.insert_color_to_gs = Insert Color to Grayscale operator.
metadata.quickfix.insert_gs_to_color = Insert Grayscale to Color operator.
And I really don't know where should I look for problem. Can somebody point me where to start.
Exception in thread "AWT-EventQueue-0" java.lang.UnsupportedOperationException
at java.util.AbstractList.add(AbstractList.java:148)
at java.util.AbstractList.add(AbstractList.java:108)
at com.burgsys.image.core.ioobjects.metadata.errors.BadColorMetaDataError.getQuickFixes(BadColorMetaDataError.java:28)
at com.rapidminer.gui.flow.ErrorTable$4.getValueAt(ErrorTable.java:249)
at com.rapidminer.gui.tools.ExtendedJTableSorterModel.getValueAt(ExtendedJTableSorterModel.java:328)
at javax.swing.JTable.getValueAt(JTable.java:2716)
at javax.swing.JTable.prepareRenderer(JTable.java:5714)
at javax.swing.plaf.basic.BasicTableUI.paintCell(BasicTableUI.java:2114)
at javax.swing.plaf.basic.BasicTableUI.paintCells(BasicTableUI.java:2016)
at javax.swing.plaf.basic.BasicTableUI.paint(BasicTableUI.java:1812)
at javax.swing.plaf.ComponentUI.update(ComponentUI.java:161)
at javax.swing.JComponent.paintComponent(JComponent.java:778)
at javax.swing.JComponent.paint(JComponent.java:1054)
at javax.swing.JComponent.paintChildren(JComponent.java:887)
at javax.swing.JComponent.paint(JComponent.java:1063)
at javax.swing.JViewport.paint(JViewport.java:731)
at javax.swing.JComponent.paintChildren(JComponent.java:887)
at javax.swing.JComponent.paint(JComponent.java:1063)
at javax.swing.JComponent.paintChildren(JComponent.java:887)
at javax.swing.JComponent.paint(JComponent.java:1063)
at javax.swing.JComponent.paintChildren(JComponent.java:887)
at javax.swing.JComponent.paint(JComponent.java:1063)
at javax.swing.JComponent.paintChildren(JComponent.java:887)
at javax.swing.JComponent.paint(JComponent.java:1063)
at javax.swing.JComponent.paintChildren(JComponent.java:887)
at javax.swing.JSplitPane.paintChildren(JSplitPane.java:1047)
at javax.swing.JComponent.paint(JComponent.java:1063)
at com.vlsolutions.swing.docking.SplitContainer.paint(SplitContainer.java:192)
at javax.swing.JComponent.paintToOffscreen(JComponent.java:5221)
at javax.swing.RepaintManager$PaintManager.paintDoubleBuffered(RepaintManager.java:1512)
at javax.swing.RepaintManager$PaintManager.paint(RepaintManager.java:1443)
at javax.swing.RepaintManager.paint(RepaintManager.java:1236)
at javax.swing.JComponent._paintImmediately(JComponent.java:5169)
at javax.swing.JComponent.paintImmediately(JComponent.java:4980)
at javax.swing.RepaintManager$3.run(RepaintManager.java:796)
at javax.swing.RepaintManager$3.run(RepaintManager.java:784)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:784)
at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:757)
at javax.swing.RepaintManager.prePaintDirtyRegions(RepaintManager.java:706)
at javax.swing.RepaintManager.access$1000(RepaintManager.java:62)
at javax.swing.RepaintManager$ProcessingRunnable.run(RepaintManager.java:1651)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:251)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:727)
at java.awt.EventQueue.access$200(EventQueue.java:103)
at java.awt.EventQueue$3.run(EventQueue.java:688)
at java.awt.EventQueue$3.run(EventQueue.java:686)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:697)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)
Thanks for your responses.
Best,
Vaclav
Tagged:
0
Answers
Take a look on the JavaDoc of the emptyList-method your are using: So you get an empty list which is immutable and thus, does not support adding and removing elements. If you call the methods from the collection interface, it will throw the UnsupportedOperationException. Try ArrayList or LinkedList instead!
Best
Marcin
thanks a lot. I should read whole API doc.
Best,
Vaclav