Skip to content

Commit 660ea68

Browse files
committed
Release 0.1.5
1 parent d7f1ce2 commit 660ea68

4 files changed

Lines changed: 61 additions & 46 deletions

File tree

changes.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
0.1.5
1+
0.1.5 (2017-10-10)
22
- Values panel made editable
33
- Byte order support for floating point numbers in values panel
44
- Added thread for values panel updating

resources/META-INF/plugin.xml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<idea-plugin version="2">
22
<id>org.exbin.deltahex.intellij</id>
33
<name>DeltaHex Editor</name>
4-
<version>0.1.5-SNAPSHOT</version>
4+
<version>0.1.5</version>
55
<vendor email="hajdam@users.sf.net" url="http://deltahex.exbin.org">ExBin Project</vendor>
66

77
<description><![CDATA[
@@ -24,9 +24,11 @@
2424
]]></description>
2525

2626
<change-notes><![CDATA[
27-
<ul><li>Fixed behavior for high precision wheel scrolling</li>
28-
<li>Fixed loading after custom font saved</li>
29-
<li>Fixed opening of read-only files</li></ul>
27+
<ul><li>Values panel made editable</li>
28+
<li>Byte order support for floating point numbers in values panel</li>
29+
<li>Added thread for values panel updating</li>
30+
<li>Fixed files closing on window closing</li>
31+
<li>Fixed clipboard charset translation</li></ul>
3032
]]>
3133
</change-notes>
3234

src/org/exbin/deltahex/delta/SegmentsRepository.java

Lines changed: 52 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -15,24 +15,21 @@
1515
*/
1616
package org.exbin.deltahex.delta;
1717

18+
import org.exbin.deltahex.delta.list.DefaultDoublyLinkedList;
19+
import org.exbin.deltahex.delta.list.DoublyLinkedItem;
20+
import org.exbin.utils.binary_data.BinaryData;
21+
1822
import java.io.File;
1923
import java.io.IOException;
2024
import java.io.RandomAccessFile;
21-
import java.util.ArrayList;
22-
import java.util.HashMap;
23-
import java.util.LinkedList;
24-
import java.util.List;
25-
import java.util.Map;
25+
import java.util.*;
2626
import java.util.logging.Level;
2727
import java.util.logging.Logger;
28-
import org.exbin.deltahex.delta.list.DefaultDoublyLinkedList;
29-
import org.exbin.deltahex.delta.list.DoublyLinkedItem;
30-
import org.exbin.utils.binary_data.BinaryData;
3128

3229
/**
3330
* Repository of delta segments.
3431
*
35-
* @version 0.1.3 2017/04/01
32+
* @version 0.1.3 2017/10/10
3633
* @author ExBin Project (http://exbin.org)
3734
*/
3835
public class SegmentsRepository {
@@ -624,68 +621,81 @@ public void dropDocument(DeltaDocument document) {
624621
public void setMemoryByte(MemorySegment memorySegment, long segmentPosition, byte value) {
625622
MemoryDataSource memorySource = memorySegment.getSource();
626623
DataSegmentsMap segmentsMap = memorySources.get(memorySource);
627-
detachMemoryArea(memorySegment, memorySegment.getStartPosition() + segmentPosition, 1);
624+
detachMemoryArea(memorySegment, segmentPosition, 1);
628625

626+
long sourcePosition = memorySegment.getStartPosition() + segmentPosition;
629627
if (segmentPosition >= memorySegment.getLength()) {
630628
segmentsMap.updateSegmentLength(memorySegment, segmentPosition + 1);
631-
if (memorySegment.getStartPosition() + segmentPosition >= memorySource.getDataSize()) {
632-
memorySource.setDataSize(memorySegment.getStartPosition() + segmentPosition + 1);
629+
if (sourcePosition >= memorySource.getDataSize()) {
630+
memorySource.setDataSize(sourcePosition + 1);
633631
}
634632
}
635633
memorySource.setByte(memorySegment.getStartPosition() + segmentPosition, value);
636634
}
637635

638-
public void insertMemoryData(MemorySegment memorySegment, long position, BinaryData insertedData) {
636+
public void insertMemoryData(MemorySegment memorySegment, long segmentPosition, BinaryData insertedData) {
639637
MemoryDataSource memorySource = memorySegment.getSource();
640638
DataSegmentsMap segmentsMap = memorySources.get(memorySource);
641-
detachMemoryArea(memorySegment, position, 0);
642-
shiftSegments(memorySegment, position, insertedData.getDataSize());
643-
memorySource.insert(position, insertedData);
639+
detachMemoryArea(memorySegment, segmentPosition, 0);
640+
641+
long sourcePosition = memorySegment.getStartPosition() + segmentPosition;
642+
shiftSegments(memorySegment, sourcePosition, insertedData.getDataSize());
643+
memorySource.insert(sourcePosition, insertedData);
644644
segmentsMap.updateSegmentLength(memorySegment, memorySegment.getLength() + insertedData.getDataSize());
645645
}
646646

647-
public void insertMemoryData(MemorySegment memorySegment, long position, BinaryData insertedData, long insertedDataOffset, long insertedDataLength) {
647+
public void insertMemoryData(MemorySegment memorySegment, long segmentPosition, BinaryData insertedData, long insertedDataOffset, long insertedDataLength) {
648648
MemoryDataSource memorySource = memorySegment.getSource();
649649
DataSegmentsMap segmentsMap = memorySources.get(memorySource);
650-
detachMemoryArea(memorySegment, position, 0);
651-
shiftSegments(memorySegment, position, insertedDataLength);
652-
memorySource.insert(position, insertedData, insertedDataOffset, insertedDataLength);
650+
detachMemoryArea(memorySegment, segmentPosition, 0);
651+
652+
long sourcePosition = memorySegment.getStartPosition() + segmentPosition;
653+
shiftSegments(memorySegment, sourcePosition, insertedDataLength);
654+
memorySource.insert(sourcePosition, insertedData, insertedDataOffset, insertedDataLength);
653655
segmentsMap.updateSegmentLength(memorySegment, memorySegment.getLength() + insertedDataLength);
654656
}
655657

656-
public void insertMemoryData(MemorySegment memorySegment, long position, byte[] insertedData) {
658+
public void insertMemoryData(MemorySegment memorySegment, long segmentPosition, byte[] insertedData) {
657659
MemoryDataSource memorySource = memorySegment.getSource();
658660
DataSegmentsMap segmentsMap = memorySources.get(memorySource);
659-
detachMemoryArea(memorySegment, position, 0);
660-
shiftSegments(memorySegment, position, insertedData.length);
661-
memorySource.insert(position, insertedData);
661+
detachMemoryArea(memorySegment, segmentPosition, 0);
662+
663+
long sourcePosition = memorySegment.getStartPosition() + segmentPosition;
664+
shiftSegments(memorySegment, sourcePosition, insertedData.length);
665+
memorySource.insert(sourcePosition, insertedData);
662666
segmentsMap.updateSegmentLength(memorySegment, memorySegment.getLength() + insertedData.length);
663667
}
664668

665-
public void insertMemoryData(MemorySegment memorySegment, long position, byte[] insertedData, int insertedDataOffset, int insertedDataLength) {
669+
public void insertMemoryData(MemorySegment memorySegment, long segmentPosition, byte[] insertedData, int insertedDataOffset, int insertedDataLength) {
666670
MemoryDataSource memorySource = memorySegment.getSource();
667671
DataSegmentsMap segmentsMap = memorySources.get(memorySource);
668-
detachMemoryArea(memorySegment, position, 0);
669-
shiftSegments(memorySegment, position, insertedDataLength);
670-
memorySource.insert(position, insertedData, insertedDataOffset, insertedDataLength);
672+
detachMemoryArea(memorySegment, segmentPosition, 0);
673+
674+
long sourcePosition = memorySegment.getStartPosition() + segmentPosition;
675+
shiftSegments(memorySegment, sourcePosition, insertedDataLength);
676+
memorySource.insert(sourcePosition, insertedData, insertedDataOffset, insertedDataLength);
671677
segmentsMap.updateSegmentLength(memorySegment, memorySegment.getLength() + insertedDataLength);
672678
}
673679

674-
public void insertMemoryData(MemorySegment memorySegment, long position, long length) {
680+
public void insertMemoryData(MemorySegment memorySegment, long segmentPosition, long length) {
675681
MemoryDataSource memorySource = memorySegment.getSource();
676682
DataSegmentsMap segmentsMap = memorySources.get(memorySource);
677-
detachMemoryArea(memorySegment, position, 0);
678-
shiftSegments(memorySegment, position, length);
679-
memorySource.insert(position, length);
683+
detachMemoryArea(memorySegment, segmentPosition, 0);
684+
685+
long sourcePosition = memorySegment.getStartPosition() + segmentPosition;
686+
shiftSegments(memorySegment, sourcePosition, length);
687+
memorySource.insert(sourcePosition, length);
680688
segmentsMap.updateSegmentLength(memorySegment, memorySegment.getLength() + length);
681689
}
682690

683-
public void insertUninitializedMemoryData(MemorySegment memorySegment, long position, long length) {
691+
public void insertUninitializedMemoryData(MemorySegment memorySegment, long segmentPosition, long length) {
684692
MemoryDataSource memorySource = memorySegment.getSource();
685693
DataSegmentsMap segmentsMap = memorySources.get(memorySource);
686-
detachMemoryArea(memorySegment, position, 0);
687-
shiftSegments(memorySegment, position, length);
688-
memorySource.insertUninitialized(position, length);
694+
detachMemoryArea(memorySegment, segmentPosition, 0);
695+
696+
long sourcePosition = memorySegment.getStartPosition() + segmentPosition;
697+
shiftSegments(memorySegment, sourcePosition, length);
698+
memorySource.insertUninitialized(sourcePosition, length);
689699
segmentsMap.updateSegmentLength(memorySegment, memorySegment.getLength() + length);
690700
}
691701

@@ -694,22 +704,23 @@ public void insertUninitializedMemoryData(MemorySegment memorySegment, long posi
694704
* segment.
695705
*
696706
* @param memorySegment provided memory segment
697-
* @param position position
707+
* @param segmentPosition position
698708
* @param length length
699709
*/
700-
public void detachMemoryArea(MemorySegment memorySegment, long position, long length) {
710+
public void detachMemoryArea(MemorySegment memorySegment, long segmentPosition, long length) {
711+
long sourcePosition = memorySegment.getStartPosition() + segmentPosition;
701712
DataSegmentsMap segmentsMap = memorySources.get(memorySegment.getSource());
702713
if (!segmentsMap.hasMoreSegments()) {
703714
return;
704715
}
705716

706-
SegmentRecord record = segmentsMap.focusFirstOverlay(position, length);
717+
SegmentRecord record = segmentsMap.focusFirstOverlay(sourcePosition, length);
707718
while (record != null) {
708719
SegmentRecord nextRecord = record.getNext();
709-
if (record.getStartPosition() > position + length) {
720+
if (record.getStartPosition() > sourcePosition + length) {
710721
break;
711722
}
712-
if (record.getStartPosition() + record.getLength() > position) {
723+
if (record.getStartPosition() + record.getLength() > sourcePosition) {
713724
DataSegment segment = record.dataSegment;
714725
if (segment != memorySegment) {
715726
detachSegment((MemorySegment) segment);

src/org/exbin/deltahex/intellij/panel/ValuesPanel.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -706,6 +706,8 @@ public void undoCommandAdded(BinaryDataCommand command) {
706706
}
707707
};
708708
undoHandler.addUndoUpdateListener(undoUpdateListener);
709+
updateEditationMode();
710+
updateValues();
709711
}
710712

711713
public void disableUpdate() {

0 commit comments

Comments
 (0)