if (linealModel == null)
{
return;
}
final GuideLineDialog spinnerDialog;
final Component parent = HorizontalLinealComponent.this;
final Window window = SwingUtil.getWindowAncestor(parent);
if (window instanceof JDialog)
{
spinnerDialog = new GuideLineDialog((JDialog) window);
}
else if (window instanceof JFrame)
{
spinnerDialog = new GuideLineDialog((JFrame) window);
}
else
{
spinnerDialog = new GuideLineDialog();
}
spinnerDialog.setUnit(WorkspaceSettings.getInstance().getUnit());
spinnerDialog.setPosition(guideLine.getPosition());
spinnerDialog.pack();
SwingUtil.centerDialogInParent(spinnerDialog);
if (spinnerDialog.showDialog())
{
final GuideLine newGuideLine = new GuideLine(spinnerDialog.getPosition(), guideLine.isActive());
linealModel.updateGuideLine(index, newGuideLine);
this.guideLine = newGuideLine;
}
}