Table cell mark/highlighting

Hello,

i have a question:

is it possible to mark/highlighting individual cells?

Best regards

Markus

I guess, you have developed your own node and want to make use of the hilting feature in KNIME. We provide a section about highlighting in our developer guide, that basically boils down to two classes that need to be used in your view implementation: those are the HiLiteHandler and HiLiteListener.

Please note that the highlighting works across all views connected to the same data source and is always row based, that is, one row highlights the same row in all other views. There are a few exceptions, for example if you work with GroupBy, Pivot, Clustering, Decision Tree, etc.: here, one row, branch, cluster, etc. can highlight a whole set of input rows, this is what we call highlight translation.

Hello,

thx, but i only want to know if it possible to highlight 1 cell, beacuse i only found the fireHiLiteEvent for a row?

 

Best regards

 

Markus

As I said, highlighting is also row-based and you need to fire the event based on the RowKey.

That means it isn`t possible to highlight 1 cell in a row?

If you know the corresponding RowKey you can highlight this single cell which is part of a whole data row.

Ok thx!

Hi,

now i want to hilite a cell of a data row and i have the corresponding RowKey. Can one of u give me a short code example to hilite a cell?

I saw your examples by Hiliting, But it didn`t help me :(

Best regards

 

Markus

There two important classes that you need to know in order to deal with hiliting. Your view need to implement the HiLiteListener-interface to react on hilite events; if your view should send out hilite events, you need to use the HiLiteHandler that you get from the underlying model. Don't hilite items directly in view, always send the event and wait to be notified. Correct, hiliting is always based on RowKeys.

I only want to hilite a cell in the table view... then i need the HiliteListener in the NodeView? (Function onOpen())?

I have to use the function:

public void hiLite(final KeyEvent event)  event = row keys or?

{
      Now I'm not sure how to hilite the cells
}

Correct, the KeyEvent contains the RowKey's to be hilit. Based on this information, you need to decide which part (rows, points, etc) of your view you want to hilit. Since I don't know how your view looks like, it's therefore hard to say how to code this. Maybe you can simply post the important parts of your NodeView?

Hello gabriel,

 

i have a normal view... i only get a standard table view as output.

my code:

public class FuelSurveyWarnSystemNodeView extends NodeView<FuelSurveyWarnSystemNodeModel> {

    /**
     * Creates a new view.
     *
     * @param nodeModel The model (class: {@link FuelSurveyWarnSystemNodeModel})
     */
    protected FuelSurveyWarnSystemNodeView(final FuelSurveyWarnSystemNodeModel nodeModel) {
        super(nodeModel);

        // TODO instantiate the components of the view here
        
    }

    public void hiLite(final KeyEvent event) {


    }
    
    /**
     * {@inheritDoc}
     */
    @Override
    protected void modelChanged() {

        // TODO retrieve the new model from your nodemodel and
        // update the view.
        FuelSurveyWarnSystemNodeModel nodeModel =
            (FuelSurveyWarnSystemNodeModel)getNodeModel();
        assert nodeModel != null;
        
        // be aware of a possibly not executed nodeModel! The data you retrieve
        // from your nodemodel could be null, emtpy, or invalid in any kind.
        
    }

    /**
     * {@inheritDoc}
     */
    @Override
    protected void onClose() {
    
        // TODO things to do when closing the view
    }

    /**
     * {@inheritDoc}
     */
    @Override
    protected void onOpen() {

        // TODO things to do when opening the view
    }

}

Your view still misses to display the actual content of your NodeModel. If you simply want to display your data in a TableView check out the corresponding class or have a look into the CorrelationComputeNodeView class for an extensive example that also demonstrates the usage of hiliting data cells and not only data rows.