# ViewRisks (ARX GUI Documentation)

org.deidentifier.arx.gui.view.impl.risk

## Class ViewRisks<T extends AnalysisContextVisualization>

- java.lang.Object
- - org.deidentifier.arx.gui.view.impl.risk.ViewRisks<T>

- Type Parameters:
    `T` -
  All Implemented Interfaces:
    IView
  Direct Known Subclasses:
    ViewRisksHIPAAIdentifiersTable, ViewRisksPopulationUniques, ViewRisksQuasiIdentifiersTable, ViewRisksReIdentification, ViewRisksReIdentificationTable, ViewRisksRiskDistributionPlot, ViewRisksRiskDistributionTable

      public abstract class ViewRisks<T extends AnalysisContextVisualization>
      extends java.lang.Object
      implements IView

  This is a base class for displaying risk estimates.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected Controller` | `controller` Internal stuff.
    `static int` | `MINIMAL_WORKING_TIME` Our users are patient.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ViewRisks(org.eclipse.swt.widgets.Composite parent, Controller controller, ModelEvent.ModelPart target, ModelEvent.ModelPart reset)` Creates a new instance.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected abstract org.eclipse.swt.widgets.Control` | `createControl(org.eclipse.swt.widgets.Composite parent)` Implement this to create the widget.
    `protected abstract T` | `createViewConfig(AnalysisContext context)` Creates a view config
    `void` | `dispose()` Disposes the view.
    `protected abstract void` | `doReset()` Implement this to reset.
    `protected abstract void` | `doUpdate(T context)` Implement this to update.
    `protected RiskEstimateBuilderInterruptible` | `getBuilder(AnalysisContextRisk context)` Creates a risk estimate builder
    `protected RiskEstimateBuilderInterruptible` | `getBuilder(AnalysisContextRisk context, ARXPopulationModel population, RiskModelHistogram classes)` Creates a risk estimate builder
    `protected RiskEstimateBuilderInterruptible` | `getBuilder(AnalysisContextRisk context, java.util.Set<java.lang.String> identifiers)` Creates a risk estimate builder
    `protected Model` | `getModel()` Returns the model
    `protected abstract ComponentStatusLabelProgressProvider` | `getProgressProvider()` May return a progress provider, if any
    `protected java.lang.String` | `getQuasiIdentifiers(AnalysisContextRisk context)` Returns a string containing all quasi-identifiers
    `protected abstract ModelRisk.ViewRiskType` | `getViewType()` Returns the according type of view
    `boolean` | `isEnabled()` Is this view enabled
    `protected boolean` | `isInput()` Is this an input data oriented control
    `protected abstract boolean` | `isRunning()` Is a job running
    `protected boolean` | `isValid()` Is there still some data to show
    `void` | `reset()` Resets the view.
    `void` | `setEnabled(boolean enabled)` Enables or disables this view
    `protected void` | `setStatusDone()` Status update.
    `protected void` | `setStatusEmpty()` Status empty.
    `protected void` | `setStatusWorking()` Status working.
    `protected void` | `triggerUpdate()` Triggers an update
    `void` | `update(ModelEvent event)` Updates the view.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### MINIMAL_WORKING_TIME

          public static final int MINIMAL_WORKING_TIME

      Our users are patient.
      See Also:
        Constant Field Values

    - #### controller

          protected final Controller controller

      Internal stuff.

  - ### Constructor Detail

    - #### ViewRisks

          public ViewRisks(org.eclipse.swt.widgets.Composite parent,
                   Controller controller,
                   ModelEvent.ModelPart target,
                   ModelEvent.ModelPart reset)

      Creates a new instance.
      Parameters:
        `parent` -
        `controller` -
        `target` -
        `reset` -

  - ### Method Detail

    - #### dispose

          public void dispose()

      Description copied from interface: `IView`
      Disposes the view.
      Specified by:
        `dispose` in interface `IView`

    - #### isEnabled

          public boolean isEnabled()

      Is this view enabled
      Returns:

    - #### reset

          public void reset()

      Description copied from interface: `IView`
      Resets the view.
      Specified by:
        `reset` in interface `IView`

    - #### setEnabled

          public void setEnabled(boolean enabled)

      Enables or disables this view
      Parameters:
        `enabled` -

    - #### update

          public void update(ModelEvent event)

      Description copied from interface: `IView`
      Updates the view.
      Specified by:
        `update` in interface `IView`

    - #### createControl

          protected abstract org.eclipse.swt.widgets.Control createControl(org.eclipse.swt.widgets.Composite parent)

      Implement this to create the widget.
      Parameters:
        `parent` -
      Returns:

    - #### createViewConfig

          protected abstract T createViewConfig(AnalysisContext context)

      Creates a view config
      Parameters:
        `context` -
      Returns:

    - #### doReset

          protected abstract void doReset()

      Implement this to reset.

    - #### doUpdate

          protected abstract void doUpdate(T context)

      Implement this to update.
      Parameters:
        `context` -

    - #### getBuilder

          protected RiskEstimateBuilderInterruptible getBuilder(AnalysisContextRisk context)

      Creates a risk estimate builder
      Parameters:
        `context` -
      Returns:

    - #### getBuilder

          protected RiskEstimateBuilderInterruptible getBuilder(AnalysisContextRisk context,
                                                    ARXPopulationModel population,
                                                    RiskModelHistogram classes)

      Creates a risk estimate builder
      Parameters:
        `context` -
        `population` -
        `classes` -
      Returns:

    - #### getBuilder

          protected RiskEstimateBuilderInterruptible getBuilder(AnalysisContextRisk context,
                                                    java.util.Set<java.lang.String> identifiers)

      Creates a risk estimate builder
      Parameters:
        `context` -
        `identifiers` -
      Returns:

    - #### getModel

          protected Model getModel()

      Returns the model
      Returns:

    - #### getProgressProvider

          protected abstract ComponentStatusLabelProgressProvider getProgressProvider()

      May return a progress provider, if any
      Returns:

    - #### getQuasiIdentifiers

          protected java.lang.String getQuasiIdentifiers(AnalysisContextRisk context)

      Returns a string containing all quasi-identifiers
      Parameters:
        `context` -
      Returns:

    - #### getViewType

          protected abstract ModelRisk.ViewRiskType getViewType()

      Returns the according type of view
      Returns:

    - #### isInput

          protected boolean isInput()

      Is this an input data oriented control
      Returns:

    - #### isRunning

          protected abstract boolean isRunning()

      Is a job running
      Returns:

    - #### isValid

          protected boolean isValid()

      Is there still some data to show
      Returns:

    - #### setStatusDone

          protected void setStatusDone()

      Status update.

    - #### setStatusEmpty

          protected void setStatusEmpty()

      Status empty.

    - #### setStatusWorking

          protected void setStatusWorking()

      Status working.

    - #### triggerUpdate

          protected void triggerUpdate()

      Triggers an update