Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

attempt for multiple livewire draws #55

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/applauncher.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function startApp() {
dwvjq.gui.setup();

// show dwv version
dwvjq.gui.appendVersionHtml('0.6.0-beta');
dwvjq.gui.appendVersionHtml(dwv.getVersion());

// application options
var filterList = ['Threshold', 'Sharpen', 'Sobel'];
Expand Down Expand Up @@ -120,6 +120,14 @@ function startApp() {
myapp.abortLoad();
}
};
window.addEventListener('dblclick', function (event) {
console.log('dblclick received');
var controller = myapp.getToolboxController();
var selectedTool = controller.getSelectedTool();
if (selectedTool instanceof dwv.tool.Livewire) {
drawListGui.performupdate();
}
});

// handle load events
var nLoadItem = null;
Expand Down
4 changes: 3 additions & 1 deletion src/gui/generic.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,9 @@ dwvjq.gui.DrawList = function (app) {
app.addEventListener('drawchange', update);
app.addEventListener('drawdelete', update);
};

this.performupdate = function(){
update({editable: this.checked});
}
/**
* Update the draw list html element
* @param {Object} event A change event, decides if the table is editable
Expand Down
9 changes: 9 additions & 0 deletions src/gui/tools.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,15 @@ dwvjq.gui.Toolbox = function (app) {
toolGuis[gui].display(false);
}
toolGuis[event.currentTarget.value].display(true);
if(event.currentTarget.value=="Livewire"){
console.log('livewire patch');
//Special processing here for livewire
// var drawDisplayDetails = app.getDrawDisplayDetails();
var st_json = app.getState();
var st = JSON.parse(st_json);
app.deleteDraws();
app.setDrawings(st.drawings,st.drawingDetails);
}
};

// tool list element
Expand Down